sensu-plugins-logstash 2.0.0 → 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
  SHA256:
3
- metadata.gz: 1d6a8ea3de650713c6d9f7af426ffb8cd69f06f3f65d8c3c679be6a5dc42bd0d
4
- data.tar.gz: 65d7ada5c842680e922fd07a2dddb405f1349c66de8dc0ca250118b308e6625b
3
+ metadata.gz: 966b4e25ca6abb9e58691dae1244bb3dd5c0408a131177f6f100de35655ae727
4
+ data.tar.gz: f6d8b6a6384a49f3706c3211216a74ed7ab1995ba354043eb6b094d77a0dff97
5
5
  SHA512:
6
- metadata.gz: 3bdca72e48de5482f11e9e89ecb20a9ce642f4167b64c60e7be2e7b19938a454754b4ee5fa371ae715c068841975d929d859308785d8748b3659428c878e7f59
7
- data.tar.gz: 5ec20b148ca23740e4b154da41bb863cf957ef1b58a51778f66559cd28c6df2f4889fb3d1b732c0e9c00b611beb48d3565dc32112843573f37384e31d1fa6a15
6
+ metadata.gz: 9e337022bc4b973063dcafc5c03d4d89a8b67c7c6818c343cd4a61bde6187b03d36ce8f2060901b20dea4d7df3a0c846fa3ff95fb0ccc31a41f2f61453cc8666
7
+ data.tar.gz: 2a9d811058cf74e9d6e9e361ca46c3f61eb13be316f04ff7e26085f76c88644c5f05ab65a90d3bd55932e49ebe76e1841f089ec76ad29de6656e14bc8291f99e
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [2.1.0] - 2018-03-14
9
+ ### Added
10
+ - Support for Logstash 6.x node stats metrics (@runningman84, @Evesy)
11
+
8
12
  ## [2.0.0] - 2017-11-07
9
13
  ### Breaking Changes
10
14
  - metrics-logstash-node.rb: Added plugin name into pipeline metrics (@Evesy)
@@ -67,6 +71,7 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
67
71
  - initial release
68
72
 
69
73
  [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-logstash/compare/2.0.0...HEAD
74
+ [2.1.0]: https://github.com/sensu-plugins/sensu-plugins-logstash/compare/2.0.0...2.1.0
70
75
  [2.0.0]: https://github.com/sensu-plugins/sensu-plugins-logstash/compare/1.3.0...2.0.0
71
76
  [1.3.0]: https://github.com/sensu-plugins/sensu-plugins-logstash/compare/1.2.0...1.3.0
72
77
  [1.2.0]: https://github.com/sensu-plugins/sensu-plugins-logstash/compare/1.1.1...1.2.0
@@ -24,7 +24,7 @@
24
24
  #
25
25
  # LICENSE:
26
26
  # Copyright 2011 Sonian, Inc <chefs@sonian.net>
27
- # Copyright 2016 Philipp Hellmich <phil@hellmi.de>
27
+ # Copyright 2018 Philipp Hellmich <phil@hellmi.de>
28
28
  # Released under the same terms as Sensu (the MIT license); see LICENSE
29
29
  # for details.
30
30
  #
@@ -113,31 +113,65 @@ class LogstashNodeMetrics < Sensu::Plugin::Metric::CLI::Graphite
113
113
  metrics['process.peak_open_file_descriptors'] = node['process']['peak_open_file_descriptors']
114
114
  metrics['process.max_file_descriptors'] = node['process']['max_file_descriptors']
115
115
 
116
- node['pipeline']['events'].each do |key, value|
117
- metrics["pipeline.events.#{key}"] = value
118
- end
119
-
120
- node['pipeline']['plugins']['inputs'].each do |item|
121
- item['events'] = {} unless item.key?('events')
122
- metrics["pipeline.plugins.inputs.#{item['name']}.#{item['id']}.events.in"] = item['events']['in'].to_i || 0
123
- metrics["pipeline.plugins.inputs.#{item['name']}.#{item['id']}.events.out"] = item['events']['out'].to_i || 0
124
- metrics["pipeline.plugins.inputs.#{item['name']}.#{item['id']}.events.queue_push_duration_in_millis"] = \
125
- item['events']['queue_push_duration_in_millis'].to_i || 0
126
- end
127
-
128
- node['pipeline']['plugins']['filters'].each do |item|
129
- item['events'] = {} unless item.key?('events')
130
- metrics["pipeline.plugins.filters.#{item['name']}.#{item['id']}.events.in"] = item['events']['in'].to_i || 0
131
- metrics["pipeline.plugins.filters.#{item['name']}.#{item['id']}.events.out"] = item['events']['out'].to_i || 0
132
- metrics["pipeline.plugins.filters.#{item['name']}.#{item['id']}.events.duration_in_millis"] = item['events']['duration_in_millis'].to_i || 0
133
- metrics["pipeline.plugins.filters.#{item['name']}.#{item['id']}.matches"] = item['matches'].to_i if item.key?('matches')
134
- end
135
-
136
- node['pipeline']['plugins']['outputs'].each do |item|
137
- item['events'] = {} unless item.key?('events')
138
- metrics["pipeline.plugins.outputs.#{item['name']}.#{item['id']}.events.in"] = item['events']['in'].to_i || 0
139
- metrics["pipeline.plugins.outputs.#{item['name']}.#{item['id']}.events.out"] = item['events']['out'].to_i || 0
140
- metrics["pipeline.plugins.outputs.#{item['name']}.#{item['id']}.events.duration_in_millis"] = item['events']['duration_in_millis'].to_i || 0
116
+ # logstash < 6.0
117
+ if node.key?('pipeline')
118
+ node['pipeline']['events'].each do |key, value|
119
+ metrics["pipeline.events.#{key}"] = value
120
+ end
121
+
122
+ node['pipeline']['plugins']['inputs'].each do |item|
123
+ item['events'] = {} unless item.key?('events')
124
+ metrics["pipeline.plugins.inputs.#{item['name']}.#{item['id']}.events.in"] = item['events']['in'].to_i || 0
125
+ metrics["pipeline.plugins.inputs.#{item['name']}.#{item['id']}.events.out"] = item['events']['out'].to_i || 0
126
+ metrics["pipeline.plugins.inputs.#{item['name']}.#{item['id']}.events.queue_push_duration_in_millis"] = \
127
+ item['events']['queue_push_duration_in_millis'].to_i || 0
128
+ end
129
+
130
+ node['pipeline']['plugins']['filters'].each do |item|
131
+ metrics["pipeline.plugins.filters.#{item['name']}.#{item['id']}.events.out"] = item['events']['out'].to_i || 0
132
+ metrics["pipeline.plugins.filters.#{item['name']}.#{item['id']}.events.duration_in_millis"] = item['events']['duration_in_millis'].to_i || 0
133
+ metrics["pipeline.plugins.filters.#{item['name']}.#{item['id']}.matches"] = item['matches'].to_i if item.key?('matches')
134
+ end
135
+
136
+ node['pipeline']['plugins']['outputs'].each do |item|
137
+ item['events'] = {} unless item.key?('events')
138
+ metrics["pipeline.plugins.outputs.#{item['name']}.#{item['id']}.events.in"] = item['events']['in'].to_i || 0
139
+ metrics["pipeline.plugins.outputs.#{item['name']}.#{item['id']}.events.out"] = item['events']['out'].to_i || 0
140
+ metrics["pipeline.plugins.outputs.#{item['name']}.#{item['id']}.events.duration_in_millis"] = item['events']['duration_in_millis'].to_i || 0
141
+ end
142
+ # logstash >= 6.0
143
+ elsif node.key?('pipelines')
144
+ node['pipelines'].each_key do |pipeline|
145
+ if node['pipelines'][pipeline]['events'].nil? || node['pipelines'][pipeline]['events'] == 'null'
146
+ # Skip
147
+ else
148
+ node['pipelines'][pipeline]['events'].each do |key, value|
149
+ metrics["pipelines.#{pipeline}.events.#{key}"] = value
150
+ end
151
+ end
152
+
153
+ node['pipelines'][pipeline]['plugins']['inputs'].each do |item|
154
+ item['events'] = {} unless item.key?('events')
155
+ metrics["pipelines.#{pipeline}.plugins.inputs.#{item['name']}.#{item['id']}.events.in"] = item['events']['in'].to_i || 0
156
+ metrics["pipelines.#{pipeline}.plugins.inputs.#{item['name']}.#{item['id']}.events.out"] = item['events']['out'].to_i || 0
157
+ metrics["pipelines.#{pipeline}.plugins.inputs.#{item['name']}.#{item['id']}.events.queue_push_duration_in_millis"] = item['events']['queue_push_duration_in_millis'].to_i || 0 # rubocop:disable Metrics/LineLength
158
+ end
159
+
160
+ node['pipelines'][pipeline]['plugins']['filters'].each do |item|
161
+ item['events'] = {} unless item.key?('events')
162
+ metrics["pipelines.#{pipeline}.plugins.filters.#{item['name']}.#{item['id']}.events.in"] = item['events']['in'].to_i || 0
163
+ metrics["pipelines.#{pipeline}.plugins.filters.#{item['name']}.#{item['id']}.events.out"] = item['events']['out'].to_i || 0
164
+ metrics["pipelines.#{pipeline}.plugins.filters.#{item['name']}.#{item['id']}.events.duration_in_millis"] = item['events']['duration_in_millis'].to_i || 0 # rubocop:disable Metrics/LineLength
165
+ metrics["pipelines.#{pipeline}.plugins.filters.#{item['name']}.#{item['id']}.matches"] = item['matches'].to_i if item.key?('matches')
166
+ end
167
+
168
+ node['pipelines'][pipeline]['plugins']['outputs'].each do |item|
169
+ item['events'] = {} unless item.key?('events')
170
+ metrics["pipelines.#{pipeline}.plugins.outputs.#{item['name']}.#{item['id']}.events.in"] = item['events']['in'].to_i || 0
171
+ metrics["pipelines.#{pipeline}.plugins.outputs.#{item['name']}.#{item['id']}.events.out"] = item['events']['out'].to_i || 0
172
+ metrics["pipelines.#{pipeline}.plugins.outputs.#{item['name']}.#{item['id']}.events.duration_in_millis"] = item['events']['duration_in_millis'].to_i || 0 # rubocop:disable Metrics/LineLength
173
+ end
174
+ end
141
175
  end
142
176
 
143
177
  metrics.each do |k, v|
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsLogstash
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 0
4
+ MINOR = 1
5
5
  PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-logstash
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-08 00:00:00.000000000 Z
11
+ date: 2018-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
250
  version: '0'
251
251
  requirements: []
252
252
  rubyforge_project:
253
- rubygems_version: 2.7.1
253
+ rubygems_version: 2.7.6
254
254
  signing_key:
255
255
  specification_version: 4
256
256
  summary: Sensu plugins for working with logstash