fluent-plugin-cloudwatch 1.2.9 → 1.2.10

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: a20b87bd696193b5ccd9a26cc9945a115900ab25
4
- data.tar.gz: 5f865c4a467d730b82fb65acb612a4e3ae04bfa7
3
+ metadata.gz: 18efcb79d2ac6f5a66b27de4ea1635d900b01fc4
4
+ data.tar.gz: c5fdce9fbb7016b4e680376e3a0eab6c4baa8dd4
5
5
  SHA512:
6
- metadata.gz: 3d01715a9470e67ab9e0fffb1947a7eae7fc89355fbbbc5b87abaed25ff33b2824356ffbe1a71e8adb46f269172de5023059e97f587b5965551767e583467eb3
7
- data.tar.gz: ba23d8287b2f153db305f425648e7ebcbf7c1502d0eddd3c0ef65a232008ee8fa944e842d2a258aee4807ece748f04f4da5274f17aa241da3d77942b922496b8
6
+ metadata.gz: 9304937b3b33a97088387902324934e72801c0dcf31db6b650868f09a9535a6a8ca6c96fed517062393ddfa413a7e814fe8656c5d489ef69be6e5549d2806dda
7
+ data.tar.gz: c3cdd59f81cd7145b199fe082ad3a5e67a231c938ef35b12da5e0abbd2f99b3d7ac5e37a63e9cfac9e30d3106bd88f6cac4fda90c2fe87947966d2e02c469c2d
data/README.md CHANGED
@@ -83,7 +83,7 @@ Get metrics from cloudwatch to fluentd.
83
83
  type cloudwatch
84
84
  tag cloudwatch
85
85
  aws_key_id YOUR_AWS_KEY_ID
86
- aws_sec_key YOUR_AWS_SECRET/KE
86
+ aws_sec_key YOUR_AWS_SECRET_KEY
87
87
  cw_endpoint monitoring.ap-northeast-1.amazonaws.com
88
88
 
89
89
  namespace AWS/ELB
@@ -111,7 +111,7 @@ Get metrics from cloudwatch to fluentd.
111
111
  type cloudwatch
112
112
  tag cloudwatch
113
113
  aws_key_id YOUR_AWS_KEY_ID
114
- aws_sec_key YOUR_AWS_SECRET/KE
114
+ aws_sec_key YOUR_AWS_SECRET_KEY
115
115
  cw_endpoint monitoring.ap-northeast-1.amazonaws.com
116
116
 
117
117
  namespace AWS/EC2
@@ -139,7 +139,7 @@ Get metrics from cloudwatch to fluentd.
139
139
  type cloudwatch
140
140
  tag cloudwatch
141
141
  aws_key_id YOUR_AWS_KEY_ID
142
- aws_sec_key YOUR_AWS_SECRET/KE
142
+ aws_sec_key YOUR_AWS_SECRET_KEY
143
143
  cw_endpoint monitoring.ap-northeast-1.amazonaws.com
144
144
 
145
145
  namespace AWS/DynamoDB
@@ -163,8 +163,9 @@ Get metrics from cloudwatch to fluentd.
163
163
  Note: Billing requires the us-east-1 endpoint
164
164
  ```config
165
165
  type cloudwatch
166
- tag cloudwatch aws_key_id YOUR_AWS_KEY_ID
167
- aws_sec_key YOUR_AWS_SECRET/KE
166
+ tag cloudwatch
167
+ aws_key_id YOUR_AWS_KEY_ID
168
+ aws_sec_key YOUR_AWS_SECRET_KEY
168
169
  cw_endpoint monitoring.us-east-1.amazonaws.com
169
170
 
170
171
  namespace AWS/Billing
@@ -189,7 +190,7 @@ Note: Billing requires the us-east-1 endpoint
189
190
  type cloudwatch
190
191
  tag cloudwatch
191
192
  aws_key_id YOUR_AWS_KEY_ID
192
- aws_sec_key YOUR_AWS_SECRET/KE
193
+ aws_sec_key YOUR_AWS_SECRET_KEY
193
194
  cw_endpoint monitoring.us-east-1.amazonaws.com
194
195
 
195
196
  namespace AWS/StorageGateway
@@ -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.9"
7
+ gem.version = "1.2.10"
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.}
@@ -62,23 +62,48 @@ class Fluent::CloudwatchInput < Fluent::Input
62
62
 
63
63
  def start
64
64
  super
65
+
65
66
  @running = true
67
+ @updated = Time.now
66
68
  @watcher = Thread.new(&method(:watch))
69
+ @monitor = Thread.new(&method(:monitor))
70
+ @mutex = Mutex.new
67
71
  end
68
72
 
69
73
  def shutdown
70
74
  super
71
75
  @running = false
72
76
  @watcher.terminate
77
+ @monitor.terminate
73
78
  @watcher.join
79
+ @monitor.join
74
80
  end
75
81
 
76
82
  private
83
+
84
+ # if watcher thread was not update timestamp in recent @interval * 2 sec., restarting it.
85
+ def monitor
86
+ log.debug "cloudwatch: monitor thread starting"
87
+ while @running
88
+ sleep @interval / 2
89
+ @mutex.synchronize do
90
+ log.debug "cloudwatch: last updated at #{@updated}"
91
+ now = Time.now
92
+ if @updated < now - @interval * 2
93
+ log.warn "cloudwatch: watcher thread is not working after #{@updated}. Restarting..."
94
+ @watcher.kill
95
+ @updated = now
96
+ @watcher = Thread.new(&method(:watch))
97
+ end
98
+ end
99
+ end
100
+ end
101
+
77
102
  def watch
78
103
  if @delayed_start
79
104
  delay = rand() * @interval
80
- log.debug("delay at start #{delay} sec")
81
- sleep(delay)
105
+ log.debug "cloudwatch: delay at start #{delay} sec"
106
+ sleep delay
82
107
  end
83
108
 
84
109
  @cw = AWS::CloudWatch.new(
@@ -96,6 +121,9 @@ class Fluent::CloudwatchInput < Fluent::Input
96
121
  if now - started >= @interval
97
122
  output
98
123
  started = now
124
+ @mutex.synchronize do
125
+ @updated = Time.now
126
+ end
99
127
  end
100
128
  end
101
129
  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: 1.2.9
4
+ version: 1.2.10
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: 2014-12-17 00:00:00.000000000 Z
13
+ date: 2015-02-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fluentd