mtr_monitor 1.4.4 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9adda583e588b133668b0e797b294dc70afba8c2
4
- data.tar.gz: 5fe07656d33476b9b8c168c17bd24cd81135ea4d
3
+ metadata.gz: 00de5b77c9aec2c650df50c7f1324f2f4c0145cd
4
+ data.tar.gz: b83d36b66a38108b983d04a8437fda0e33a9563f
5
5
  SHA512:
6
- metadata.gz: bfc2209b6f8e1de75130a1ee709ec5773a06725ad1a54ebb57f911dbcc4744041723ed7137d935e9a5152696ee18f1e72fb7fde434347eadb5bdc0f3b06425ba
7
- data.tar.gz: 237fb3eb80b0474eb6e89bde3309ccc6ca5057ccc74220913d798f7274dac6a25472776d54dd29ec19852ae0ef08c2d84183538e8a5df7199e2e01db37f4c759
6
+ metadata.gz: 5ecf3e3b331d642c964afb2ab325037e7972e008b09212d2e8c141a5f96be120ef109e32eb9b418881b743d8fc0be0ae520a7a1a2a24ef35eb42bc25a274c2bb
7
+ data.tar.gz: 6d5e21a42e1c62d3d1ae79fda623c03868f9cfa35dd7c6c6f70e4eb0eee3c6be806fd7335667f12bb128543b4356ef63b927b9334eea8cd11df8ba42eaa91f2d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mtr_monitor (1.4.4)
4
+ mtr_monitor (1.5.0)
5
5
  logdna
6
6
  rt-watchman (~> 0.10.0)
7
7
 
@@ -1,11 +1,11 @@
1
1
  module MtrMonitor
2
- class Tier1Logger
2
+ class LogDna
3
3
 
4
4
  def self.submit(*args)
5
5
  new(*args).submit
6
6
  end
7
7
 
8
- def initialize(route_name, logdna_ingestion_key, local_log_path, host_ip_address, s3_url, logger)
8
+ def initialize(route_name, logdna_ingestion_key, local_log_path, host_ip_address, s3_url, hostname, logger)
9
9
  config = {
10
10
  :ip => host_ip_address,
11
11
  :app => "mtr-monitor",
@@ -14,6 +14,7 @@ module MtrMonitor
14
14
 
15
15
  @route_name = route_name
16
16
  @s3_url = s3_url
17
+ @hostname = hostname
17
18
 
18
19
  @mtr_log = File.read(local_log_path)
19
20
  @logdna = Logdna::Ruby.new(logdna_ingestion_key, config)
@@ -21,8 +22,10 @@ module MtrMonitor
21
22
  end
22
23
 
23
24
  def submit
24
- @logdna.log("Route: #{@route_name}, Tier1: #{tier1_provider}, s3: #{@s3_url}")
25
- @logger.info("Network provider: #{tier1_provider} -- Emitted to LogDNA")
25
+ msg = "Route: #{@route_name}, Host: #{@hostname}, Tier1: #{tier1_provider}, s3: #{@s3_url}"
26
+
27
+ @logdna.log(@msg)
28
+ @logger.info("Emitted to LogDNA: #{msg}")
26
29
  end
27
30
 
28
31
  private
@@ -35,9 +38,9 @@ module MtrMonitor
35
38
  elsif @mtr_log.include?("ntt.net")
36
39
  "NTT"
37
40
  elsif @mtr_log.include?("core-backbone.com")
38
- "Core Backbone"
41
+ "Core_Backbone"
39
42
  else
40
- "Unknown network provider"
43
+ "Unknown"
41
44
  end
42
45
  end
43
46
 
@@ -1,3 +1,3 @@
1
1
  module MtrMonitor
2
- VERSION = "1.4.4"
2
+ VERSION = "1.5.0"
3
3
  end
data/lib/mtr_monitor.rb CHANGED
@@ -5,7 +5,7 @@ require "logdna"
5
5
  require "mtr_monitor/version"
6
6
  require "mtr_monitor/hop"
7
7
  require "mtr_monitor/metrics"
8
- require "mtr_monitor/tier1_logger"
8
+ require "mtr_monitor/log_dna"
9
9
  require "mtr_monitor/cleaner"
10
10
 
11
11
  module MtrMonitor
@@ -71,7 +71,7 @@ module MtrMonitor
71
71
  generate_local_report
72
72
  upload_to_s3
73
73
 
74
- MtrMonitor::Tier1Logger.submit(@name, @logdna_ingestion_key, local_log_path, @host_ip_address, s3_url, @logger)
74
+ MtrMonitor::LogDna.submit(@name, @logdna_ingestion_key, local_log_path, @host_ip_address, s3_url, @hostname, @logger)
75
75
  MtrMonitor::Metrics.submit(local_log_path, @hostname, @name, @logger)
76
76
  end
77
77
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mtr_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - RenderedText DevOps Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-21 00:00:00.000000000 Z
11
+ date: 2018-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logdna
@@ -108,8 +108,8 @@ files:
108
108
  - lib/mtr_monitor.rb
109
109
  - lib/mtr_monitor/cleaner.rb
110
110
  - lib/mtr_monitor/hop.rb
111
+ - lib/mtr_monitor/log_dna.rb
111
112
  - lib/mtr_monitor/metrics.rb
112
- - lib/mtr_monitor/tier1_logger.rb
113
113
  - lib/mtr_monitor/version.rb
114
114
  - mtr_monitor.gemspec
115
115
  homepage: https://github.com/renderedtext/mtr-monitor