fluent-plugin-cloudwatch 1.2.15 → 2.0.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: 9d3adafa0bd5e4b4d0b9293883ea4fb366b58aba
4
- data.tar.gz: f22c8670fc9f3e444c1637518ddfc70056956dab
3
+ metadata.gz: e56dcbc7fca4a826278f668a470737bef1cf5e82
4
+ data.tar.gz: 2cec16038b6a867eaeddee772afcb0494f4024f2
5
5
  SHA512:
6
- metadata.gz: 4d35af6e89189ef74e7fbe72b997ddbc93c54dc881498693813f6dbb72c53304418f6ab3cf5cf0645c39073315b9d0f197e3b1862adf1c058874e09902ed6a92
7
- data.tar.gz: 110297ebd921c428da1b06cc1144e34a6cafa5b846afdaf618345bf3c4451b229d2f374248c33345eb2bb83c847b6ac7a970e05202e1eef7e47923a7ea879430
6
+ metadata.gz: e0d28f73d412da3e7c21a9b8baeef13ca2750de2554176acbc9025e1adc835c4014125f34747a782f5ad5abc78048d9136d049594436f23c96924cc739d9f1bd
7
+ data.tar.gz: d2e956208f697e388d36dac96a1be67a1fa78ec2493f056453f1ed5b86f63d99759606e34af9219851a26ed993ea77e667bc2cb5425a6560b25253f06151c7bd
@@ -4,18 +4,9 @@ before_install:
4
4
  - gem update bundler
5
5
 
6
6
  rvm:
7
- - 2.0.0
8
- - 2.1.8
9
- - 2.2.4
7
+ - 2.1.*
8
+ - 2.2.*
10
9
  - 2.3.0
11
-
12
10
  gemfile:
13
11
  - Gemfile
14
- - Gemfile.fluentd.0.10
15
-
16
- matrix:
17
- exclude:
18
- - rvm: 2.2.4
19
- gemfile: Gemfile.fluentd.0.10
20
- - rvm: 2.3.0
21
- gemfile: Gemfile.fluentd.0.10
12
+ - Gemfile.fluentd.0.12
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'fluentd', '~> 0.12.0'
4
+ gemspec
data/README.md CHANGED
@@ -16,7 +16,7 @@ Get metrics from cloudwatch to fluentd.
16
16
 
17
17
  ```config
18
18
  <source>
19
- type cloudwatch
19
+ @type cloudwatch
20
20
  tag cloudwatch
21
21
  aws_key_id YOUR_AWS_KEY_ID
22
22
  aws_sec_key YOUR_AWS_SECRET_KEY
@@ -38,7 +38,7 @@ Get metrics from cloudwatch to fluentd.
38
38
 
39
39
  ```config
40
40
  <source>
41
- type cloudwatch
41
+ @type cloudwatch
42
42
  tag cloudwatch
43
43
  aws_key_id YOUR_AWS_KEY_ID
44
44
  aws_sec_key YOUR_AWS_SECRET_KEY
@@ -51,9 +51,9 @@ Get metrics from cloudwatch to fluentd.
51
51
  </source>
52
52
 
53
53
  <match cloudwatch>
54
- type copy
54
+ @type copy
55
55
  <store>
56
- type file
56
+ @type file
57
57
  path /var/log/td-agent/test
58
58
  </store>
59
59
  </match>
@@ -81,7 +81,7 @@ Get metrics from cloudwatch to fluentd.
81
81
 
82
82
  ```config
83
83
  <source>
84
- type cloudwatch
84
+ @type cloudwatch
85
85
  tag cloudwatch
86
86
  aws_key_id YOUR_AWS_KEY_ID
87
87
  aws_sec_key YOUR_AWS_SECRET_KEY
@@ -109,7 +109,7 @@ Get metrics from cloudwatch to fluentd.
109
109
 
110
110
  ```config
111
111
  <source>
112
- type cloudwatch
112
+ @type cloudwatch
113
113
  tag cloudwatch
114
114
  aws_key_id YOUR_AWS_KEY_ID
115
115
  aws_sec_key YOUR_AWS_SECRET_KEY
@@ -137,7 +137,7 @@ Get metrics from cloudwatch to fluentd.
137
137
  ### GET DynamoDB Metirc
138
138
 
139
139
  ```config
140
- type cloudwatch
140
+ @type cloudwatch
141
141
  tag cloudwatch
142
142
  aws_key_id YOUR_AWS_KEY_ID
143
143
  aws_sec_key YOUR_AWS_SECRET_KEY
@@ -163,7 +163,7 @@ Get metrics from cloudwatch to fluentd.
163
163
 
164
164
  Note: Billing requires the us-east-1 endpoint
165
165
  ```config
166
- type cloudwatch
166
+ @type cloudwatch
167
167
  tag cloudwatch
168
168
  aws_key_id YOUR_AWS_KEY_ID
169
169
  aws_sec_key YOUR_AWS_SECRET_KEY
@@ -188,7 +188,7 @@ Note: Billing requires the us-east-1 endpoint
188
188
  ### GET StorageGateway Metirc
189
189
 
190
190
  ```config
191
- type cloudwatch
191
+ @type cloudwatch
192
192
  tag cloudwatch
193
193
  aws_key_id YOUR_AWS_KEY_ID
194
194
  aws_sec_key YOUR_AWS_SECRET_KEY
@@ -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 = "1.2.15"
7
+ gem.version = "2.0.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.}
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
16
  gem.require_paths = ["lib"]
17
17
  gem.add_dependency "fluentd", ">= 0.10.30"
18
- gem.add_dependency "aws-sdk-v1", "~> 1.59.1"
18
+ gem.add_dependency "aws-sdk", "~> 2"
19
19
  gem.add_development_dependency "rake", ">= 0.9.2"
20
20
  gem.add_development_dependency "test-unit", ">= 3.1.0"
21
21
  gem.license = 'MIT'
@@ -1,3 +1,7 @@
1
+ require 'fluent/input'
2
+ require 'aws-sdk'
3
+ require 'uri'
4
+
1
5
  class Fluent::CloudwatchInput < Fluent::Input
2
6
  Fluent::Plugin.register_input("cloudwatch", self)
3
7
 
@@ -33,7 +37,6 @@ class Fluent::CloudwatchInput < Fluent::Input
33
37
 
34
38
  def initialize
35
39
  super
36
- require 'aws-sdk-v1'
37
40
  end
38
41
 
39
42
  def configure(conf)
@@ -56,10 +59,12 @@ class Fluent::CloudwatchInput < Fluent::Input
56
59
  })
57
60
  end
58
61
 
59
- AWS.config(
60
- :http_open_timeout => @open_timeout,
61
- :http_read_timeout => @read_timeout,
62
- )
62
+ endpoint = URI(@cw_endpoint)
63
+ if endpoint.scheme != "http" && endpoint.scheme != "https"
64
+ @cw_endpoint_uri = "https://#{@cw_endpoint}"
65
+ else
66
+ @cw_endpoint_uri = endpoint.to_s
67
+ end
63
68
  end
64
69
 
65
70
  def start
@@ -102,18 +107,20 @@ class Fluent::CloudwatchInput < Fluent::Input
102
107
  end
103
108
 
104
109
  def watch
110
+ log.debug "cloudwatch: watch thread starting"
105
111
  if @delayed_start
106
112
  delay = rand() * @interval
107
113
  log.debug "cloudwatch: delay at start #{delay} sec"
108
114
  sleep delay
109
115
  end
110
116
 
111
- @cw = AWS::CloudWatch.new(
112
- :access_key_id => @aws_key_id,
113
- :secret_access_key => @aws_sec_key,
114
- :cloud_watch_endpoint => @cw_endpoint,
115
- ).client
116
-
117
+ @cw = Aws::CloudWatch::Client.new(
118
+ :access_key_id => @aws_key_id,
119
+ :secret_access_key => @aws_sec_key,
120
+ :endpoint => @cw_endpoint_uri,
121
+ :http_open_timeout => @open_timeout,
122
+ :http_read_timeout => @read_timeout,
123
+ )
117
124
  output
118
125
 
119
126
  started = Time.now
@@ -135,6 +142,7 @@ class Fluent::CloudwatchInput < Fluent::Input
135
142
  name, s = m.split(":")
136
143
  s ||= @statistics
137
144
  now = Time.now - @offset
145
+ log.debug("now #{now}")
138
146
  statistics = @cw.get_metric_statistics({
139
147
  :namespace => @namespace,
140
148
  :metric_name => name,
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'bundler'
3
+ require 'fluent/input'
3
4
 
4
5
  begin
5
6
  Bundler.setup(:default, :development)
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: 1.2.15
4
+ version: 2.0.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: 2016-04-15 00:00:00.000000000 Z
13
+ date: 2017-03-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fluentd
@@ -27,19 +27,19 @@ dependencies:
27
27
  - !ruby/object:Gem::Version
28
28
  version: 0.10.30
29
29
  - !ruby/object:Gem::Dependency
30
- name: aws-sdk-v1
30
+ name: aws-sdk
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: 1.59.1
35
+ version: '2'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 1.59.1
42
+ version: '2'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rake
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +80,7 @@ files:
80
80
  - ".gitignore"
81
81
  - ".travis.yml"
82
82
  - Gemfile
83
- - Gemfile.fluentd.0.10
83
+ - Gemfile.fluentd.0.12
84
84
  - LICENSE
85
85
  - README.md
86
86
  - Rakefile
@@ -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.4.5
111
+ rubygems_version: 2.6.6
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Input plugin for AWS CloudWatch.
@@ -1,5 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in fluent-plugin-cloudwatch.gemspec
4
- gem 'fluentd', '= 0.10.30'
5
- gemspec