fluent-plugin-cloudwatch 2.0.1 → 2.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98b0e87a73f102d68f0987b91514ad3ef5f5d34e
4
- data.tar.gz: b259121bdf5da5113b223d4f5d87ce909d130913
3
+ metadata.gz: 57e317fa3685f8cbe444fa5483dd89ed1dd85e1c
4
+ data.tar.gz: 34db441dddcf273cafa6e5da45500a02386065a1
5
5
  SHA512:
6
- metadata.gz: ed1f124bf94ae7d737498a1395958f978ea6814a77223b23463631e34c2a4a95da5a8163947af08ec8bf4c54c42ce695bb03e26eab3b30f8a5c7d8bb59620dc9
7
- data.tar.gz: f795231cf8657546aa68a77c990d7a21231bbdd4fc6440cdebe121cf1046b078193069cfc2984e0906783cd789a6708bc6d132155bcac3db3bfa4dd110e9a056
6
+ metadata.gz: 5f73145f2f180bc8da10be7a3c92b2997a304803886d412d4478bb5f38a89a108c6f3bb7fbae6b9d07cd81b7d59e682b559bb2eb6456e21dc32cd6c83c9a9766
7
+ data.tar.gz: 7abc322f510684c3ee571844b91e41561c627e84bb213f47800d0f3740f63ba4f3d97a2b30acab0b794f2bf7441ec1b874746cb7ec964bd394c89cc239cc625c
data/README.md CHANGED
@@ -239,6 +239,36 @@ If `offset` is specified, fluent-plugin-cloudwatch gets metrics between `offset`
239
239
 
240
240
  If `emit_zero` is true and cloudwatch datapoint is empty, fluent-plugin-cloudwatch emits 0 instead of warn log "datapoint is empty".
241
241
 
242
+ ## config: record_attr
243
+
244
+ `record_attr` is an optional value injected into each records.
245
+
246
+ ```
247
+ <source>
248
+ @type cloudwatch
249
+ tag cloudwatch.rds
250
+ aws_key_id YOUR_AWS_KEY_ID
251
+ aws_sec_key YOUR_AWS_SECRET_KEY
252
+ cw_endpoint monitoring.ap-northeast-1.amazonaws.com
253
+
254
+ namespace AWS/RDS
255
+ metric_name CPUUtilization,FreeStorageSpace
256
+ dimensions_name DBInstanceIdentifier
257
+ dimensions_value rds01
258
+ record_attr DBInstanceIdentifier:rds01
259
+ # JSON format
260
+ # record_attr {"DBInstanceIdentifier":"rds01"}
261
+ </source>
262
+ ```
263
+
264
+ Example output.
265
+
266
+ ```
267
+ 2017-11-04T13:40:00+09:00 cloudwatch.rds {"CPUUtilization":2.0,"DBInstanceIdentifier":"rds01"}
268
+ 2013-11-04T13:40:00+09:00 cloudwatch.rds {"FreeStorageSpace":104080723968.0,"DBInstanceIdentifier":"rds01"}
269
+ ```
270
+
271
+
242
272
  ## Contributing
243
273
 
244
274
  1. Fork it
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "fluent-plugin-cloudwatch"
7
- gem.version = "2.0.1"
7
+ gem.version = "2.1.0"
8
8
  gem.authors = ["Yusuke Nomura", "kenjiskywalker", "FUJIWARA Shunichiro"]
9
9
  gem.email = ["yunomu@gmail.com", "git@kenjiskywalker.org", "fujiwara.shunichiro@gmail.com"]
10
10
  gem.description = %q{Input plugin for AWS CloudWatch.}
@@ -33,6 +33,7 @@ class Fluent::CloudwatchInput < Fluent::Input
33
33
  config_param :delayed_start, :bool, :default => false
34
34
  config_param :offset, :integer, :default => 0
35
35
  config_param :emit_zero, :bool, :default => false
36
+ config_param :record_attr, :hash, :default => {}
36
37
 
37
38
  attr_accessor :dimensions
38
39
 
@@ -164,9 +165,9 @@ class Fluent::CloudwatchInput < Fluent::Input
164
165
 
165
166
  # unix time
166
167
  catch_time = datapoint[:timestamp].to_i
167
- router.emit(tag, catch_time, { name => data })
168
+ router.emit(tag, catch_time, { name => data }.merge(@record_attr))
168
169
  elsif @emit_zero
169
- router.emit(tag, now.to_i, { name => 0 })
170
+ router.emit(tag, now.to_i, { name => 0 }.merge(@record_attr))
170
171
  else
171
172
  log.warn "cloudwatch: #{@namespace} #{@dimensions_name} #{@dimensions_value} #{name} #{s} datapoints is empty"
172
173
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-cloudwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke Nomura
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-03-23 00:00:00.000000000 Z
13
+ date: 2017-11-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fluentd
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.6.6
111
+ rubygems_version: 2.6.11
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Input plugin for AWS CloudWatch.