fluent-plugin-cloudwatch 1.2.15 → 2.0.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 +4 -4
- data/.travis.yml +3 -12
- data/Gemfile.fluentd.0.12 +4 -0
- data/README.md +9 -9
- data/fluent-plugin-cloudwatch.gemspec +2 -2
- data/lib/fluent/plugin/in_cloudwatch.rb +19 -11
- data/test/helper.rb +1 -0
- metadata +7 -7
- data/Gemfile.fluentd.0.10 +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e56dcbc7fca4a826278f668a470737bef1cf5e82
|
4
|
+
data.tar.gz: 2cec16038b6a867eaeddee772afcb0494f4024f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0d28f73d412da3e7c21a9b8baeef13ca2750de2554176acbc9025e1adc835c4014125f34747a782f5ad5abc78048d9136d049594436f23c96924cc739d9f1bd
|
7
|
+
data.tar.gz: d2e956208f697e388d36dac96a1be67a1fa78ec2493f056453f1ed5b86f63d99759606e34af9219851a26ed993ea77e667bc2cb5425a6560b25253f06151c7bd
|
data/.travis.yml
CHANGED
@@ -4,18 +4,9 @@ before_install:
|
|
4
4
|
- gem update bundler
|
5
5
|
|
6
6
|
rvm:
|
7
|
-
- 2.
|
8
|
-
- 2.
|
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.
|
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
|
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 = "
|
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
|
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
|
-
|
60
|
-
|
61
|
-
|
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 =
|
112
|
-
:access_key_id
|
113
|
-
:secret_access_key
|
114
|
-
:
|
115
|
-
|
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,
|
data/test/helper.rb
CHANGED
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:
|
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:
|
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
|
30
|
+
name: aws-sdk
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
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:
|
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.
|
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.
|
111
|
+
rubygems_version: 2.6.6
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Input plugin for AWS CloudWatch.
|