logstash-output-cloudwatch 3.0.10 → 3.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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/logstash/outputs/cloudwatch.rb +10 -13
- data/logstash-output-cloudwatch.gemspec +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 481a88fcce877164a1509394ea7b544ae0a91a987994cd83c9077708f38d2e23
|
4
|
+
data.tar.gz: af740d8bbe2c0d2a68121fd2ea01656cc85e1dac925febcbf2cdea2b04b573ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70e7b7b78a0ec49a2b47de1c61226b9302f2798e742f9b68a95d6802a43285169251be6169e655ef253c824d5fb1aa0fe6fe194ac40c5375b70161aabd3db1f8
|
7
|
+
data.tar.gz: cd20f4ead9f8d4e1d224d96a766fa3194e8b9a85de175761950c4e3f59afed38c00156669b437adc87cd6caf27e11bc20e432753768786df34864b62e4a46ca2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 3.1.0
|
2
|
+
- Refactor: switch to using the scheduler mixin [#22](https://github.com/logstash-plugins/logstash-output-cloudwatch/pull/22)
|
3
|
+
|
1
4
|
## 3.0.10
|
2
5
|
- Deps: unpin rufus scheduler [#20](https://github.com/logstash-plugins/logstash-output-cloudwatch/pull/20)
|
3
6
|
- Fix: an old undefined method error which would surface with load (as queue fills up)
|
@@ -2,8 +2,7 @@
|
|
2
2
|
require "logstash/outputs/base"
|
3
3
|
require "logstash/namespace"
|
4
4
|
require "logstash/plugin_mixins/aws_config"
|
5
|
-
|
6
|
-
require "rufus/scheduler"
|
5
|
+
require "logstash/plugin_mixins/scheduler"
|
7
6
|
|
8
7
|
# This output lets you aggregate and send metric data to AWS CloudWatch
|
9
8
|
#
|
@@ -64,6 +63,7 @@ require "rufus/scheduler"
|
|
64
63
|
# http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html[PutMetricData]
|
65
64
|
class LogStash::Outputs::CloudWatch < LogStash::Outputs::Base
|
66
65
|
include LogStash::PluginMixins::AwsConfig::V2
|
66
|
+
include LogStash::PluginMixins::Scheduler
|
67
67
|
|
68
68
|
config_name "cloudwatch"
|
69
69
|
|
@@ -166,28 +166,25 @@ class LogStash::Outputs::CloudWatch < LogStash::Outputs::Base
|
|
166
166
|
@cw = Aws::CloudWatch::Client.new(aws_options_hash)
|
167
167
|
|
168
168
|
@event_queue = SizedQueue.new(@queue_size)
|
169
|
-
|
170
|
-
@job =
|
171
|
-
@logger.debug("Scheduler Activated")
|
172
|
-
publish(aggregate({}))
|
173
|
-
end
|
169
|
+
|
170
|
+
@job = scheduler.every(@timeframe) { do_publish }
|
174
171
|
end # def register
|
175
172
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
173
|
+
def do_publish
|
174
|
+
publish(aggregate({}))
|
175
|
+
end
|
176
|
+
private :do_publish
|
180
177
|
|
181
178
|
public
|
182
179
|
def receive(event)
|
183
180
|
return unless (event.get(@field_metricname) || @metricname)
|
184
181
|
|
185
182
|
if (@event_queue.length >= @event_queue.max)
|
186
|
-
|
183
|
+
do_publish
|
187
184
|
@logger.warn("Posted to AWS CloudWatch ahead of schedule. If you see this often, consider increasing the cloudwatch queue_size option.")
|
188
185
|
end
|
189
186
|
|
190
|
-
@logger.debug("Queueing event", :event => event)
|
187
|
+
@logger.debug? && @logger.debug("Queueing event", :event => event.to_hash)
|
191
188
|
@event_queue << event
|
192
189
|
end # def receive
|
193
190
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-output-cloudwatch'
|
4
|
-
s.version = '3.0
|
4
|
+
s.version = '3.1.0'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Aggregates and sends metric data to AWS CloudWatch"
|
7
7
|
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
# Gem dependencies
|
23
23
|
s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
|
24
24
|
s.add_runtime_dependency 'logstash-mixin-aws', '>= 1.0.0'
|
25
|
-
s.add_runtime_dependency
|
25
|
+
s.add_runtime_dependency "logstash-mixin-scheduler", '~> 1.0'
|
26
26
|
|
27
27
|
s.add_development_dependency 'logstash-devutils'
|
28
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-cloudwatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -47,17 +47,17 @@ dependencies:
|
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|
50
|
-
- - "
|
50
|
+
- - "~>"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
53
|
-
name:
|
52
|
+
version: '1.0'
|
53
|
+
name: logstash-mixin-scheduler
|
54
54
|
prerelease: false
|
55
55
|
type: :runtime
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - "
|
58
|
+
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
60
|
+
version: '1.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
requirement: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|