riemann-aws 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/riemann-elb-metrics +20 -14
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dfd02105846c4a1f953688c2899cdd5125e9153a
4
- data.tar.gz: 82b7d4a48d0f9567bc176a40413dc3a4c47324e4
3
+ metadata.gz: 53369cc4951c585ad4512b0f5cb8787fc62afc30
4
+ data.tar.gz: 1b8d9e2dce92e426dd0f3776caef75b3b2ab25de
5
5
  SHA512:
6
- metadata.gz: 760e425010f9352254fd32657add826d4ed8376cfa3de73871e3e10f21795ccf14559152fae058d442264d4bd952fe69a990228866df5e0148260c664bb3112c
7
- data.tar.gz: 8ce13919f5fc5ac10304d6d35bfdc8320ad9e24d02554978a098e6856f5faf02116d0af645b5c4601c803b91a92853f3b0726f9a6d682cb008d3b6a27d17cd76
6
+ metadata.gz: 8833446b2ac85047da34dbdaa2d2a4e2f8e1fe798b0ec6ad682739dd8af15ef1d7948c551e2a0568a03ef01208b4134b8d263af6eb685ef91612952fd2bf9dce
7
+ data.tar.gz: 2bd11a72ed228865e285db7bc0ea05e4eeb47633f4a5adac002f35856f99b96c2363217f66dbe91381dea8a92142a0ccb2c142f92765e5b4c4155b87b88f0026
@@ -127,10 +127,13 @@ class Riemann::Tools::ELBMetrics
127
127
  # the given time period, values for these metrics will not be recorded in CloudWatch"
128
128
  #next if result.body["GetMetricStatisticsResult"]["Datapoints"].empty? && metric_type =~ /[2345]XX/
129
129
  #
130
- # BUG:
131
- # Metrics are reported every 60 seconds, but sometimes there isn't one there yet.
132
- # We can skip that, or do something else?
133
- next if result.body["GetMetricStatisticsResult"]["Datapoints"].empty?
130
+ if result.body["GetMetricStatisticsResult"]["Datapoints"].empty?
131
+ standard_metrics[metric_type]['Statistics'].each do |stat_type|
132
+ event = event(lb, az, metric_type, stat_type, 0.0)
133
+ report(event)
134
+ end
135
+ next
136
+ end
134
137
 
135
138
  # We should only ever have a single data point
136
139
  result.body["GetMetricStatisticsResult"]["Datapoints"][0].keys.sort.each do |stat_type|
@@ -139,22 +142,25 @@ class Riemann::Tools::ELBMetrics
139
142
 
140
143
  unit = result.body["GetMetricStatisticsResult"]["Datapoints"][0]["Unit"]
141
144
  metric = result.body["GetMetricStatisticsResult"]["Datapoints"][0][stat_type]
142
- event = Hash.new
143
- event = {
144
- host: lb,
145
- service: "elb.#{az}.#{metric_type}.#{stat_type}",
146
- ttl: 60,
147
- description: "#{lb} #{metric_type} #{stat_type} (#{unit})",
148
- tags: [ "production", "elb_metrics" ],
149
- metric: metric
150
- }
151
-
145
+ event = event(lb, az, metric_type, stat_type, metric, unit)
152
146
  report(event)
153
147
  end
154
148
  end
155
149
  end
156
150
  end
157
151
  end
152
+
153
+ private
154
+ def event(lb, az, metric_type, stat_type, metric, unit=nil)
155
+ event = {
156
+ host: lb,
157
+ service: "elb.#{az}.#{metric_type}.#{stat_type}",
158
+ ttl: 60,
159
+ description: "#{lb} #{metric_type} #{stat_type} (#{unit})",
160
+ tags: ["elb_metrics"],
161
+ metric: metric
162
+ }
163
+ end
158
164
  end
159
165
 
160
166
  Riemann::Tools::ELBMetrics.run
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Kingsbury
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-09 00:00:00.000000000 Z
11
+ date: 2016-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: riemann-tools