fluent-plugin-prometheus 2.0.2 → 2.0.3

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
  SHA256:
3
- metadata.gz: 949d2ec196fae78bdfcbbfeae20d718e7a3a34a6ceba9ba665d1a7d40326d529
4
- data.tar.gz: c1adf9a63565a38141247034157f84aadb85336e5add24ca6d99c126cd8e01d7
3
+ metadata.gz: 21b4b3d81d41fadb057a133293f2629b39961faaadcb7caebbd885c10ed344d1
4
+ data.tar.gz: dbd8aa719306aa164f373c781f568b82bee27fc44bfc88e86c4ea5d31c5ce545
5
5
  SHA512:
6
- metadata.gz: 7199fc669d4c389fa5638615d16a4fdb29a27cc959b60c3ec6e3031328a9cb052bb6169733c73e66f659ec929aa3faffd8869187dc70f6eff361263b3304ecb0
7
- data.tar.gz: acfbe23681c5bf801ae10c41a265dfb358b05516b79d0e2944317469b0b4be8aad5b1fbda246d9e4caa0e75f473428046015232c0900689ccb629a3b7c5b72a8
6
+ metadata.gz: ca73efb455416a5e7c022793c17ae088cd685f5751e3497a501f9af880a5f9e970dd838c939d3b61e9145c92e2a0d3acff3d61fbde35a88c7f29e52b148de5c4
7
+ data.tar.gz: 9feaab5d5b45e6e9cb1bd48ea3bc47381db6c9cc806e4782fab18df21b093f4034ca8215202e32f64cd776ea695a385f195b3b02ab22679e8b3c01b97b2bd27c
@@ -1,7 +1,9 @@
1
1
  name: linux
2
2
  on:
3
- - push
4
- - pull_request
3
+ push:
4
+ branches: [master]
5
+ pull_request:
6
+ branches: [master]
5
7
  jobs:
6
8
  build:
7
9
  runs-on: ${{ matrix.os }}
@@ -9,7 +11,7 @@ jobs:
9
11
  strategy:
10
12
  fail-fast: false
11
13
  matrix:
12
- ruby: [ '2.5', '2.6', '2.7', '3.0' ]
14
+ ruby: [ '3.1', '3.0', '2.7', '2.6' ]
13
15
  os:
14
16
  - ubuntu-latest
15
17
  experimental: [false]
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Release 2.0.3 - 2022/05/06
2
+
3
+ * in_prometheus_output_monitor: Fix a bug where output_status_num_errors metric is missing
4
+
1
5
  Release 2.0.2 - 2021/08/02
2
6
 
3
7
  * in_prometheus_output_monitor: Follow Fluentd's core metrics mechanism
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "fluent-plugin-prometheus"
3
- spec.version = "2.0.2"
3
+ spec.version = "2.0.3"
4
4
  spec.authors = ["Masahiro Sano"]
5
5
  spec.email = ["sabottenda@gmail.com"]
6
6
  spec.summary = %q{A fluent plugin that collects metrics and exposes for Prometheus.}
@@ -133,25 +133,24 @@ module Fluent::Plugin
133
133
 
134
134
  monitor_info = {
135
135
  # buffer metrics
136
- 'buffer_total_queued_size' => @metrics[:buffer_total_queued_size],
137
- 'buffer_stage_length' => @metrics[:buffer_stage_length],
138
- 'buffer_stage_byte_size' => @metrics[:buffer_stage_byte_size],
139
- 'buffer_queue_length' => @metrics[:buffer_queue_length],
140
- 'buffer_queue_byte_size' => @metrics[:buffer_queue_byte_size],
141
- 'buffer_available_buffer_space_ratios' => @metrics[:buffer_available_buffer_space_ratios],
142
- 'buffer_newest_timekey' => @metrics[:buffer_newest_timekey],
143
- 'buffer_oldest_timekey' => @metrics[:buffer_oldest_timekey],
136
+ 'buffer_total_queued_size' => [@metrics[:buffer_total_queued_size]],
137
+ 'buffer_stage_length' => [@metrics[:buffer_stage_length]],
138
+ 'buffer_stage_byte_size' => [@metrics[:buffer_stage_byte_size]],
139
+ 'buffer_queue_length' => [@metrics[:buffer_queue_length]],
140
+ 'buffer_queue_byte_size' => [@metrics[:buffer_queue_byte_size]],
141
+ 'buffer_available_buffer_space_ratios' => [@metrics[:buffer_available_buffer_space_ratios]],
142
+ 'buffer_newest_timekey' => [@metrics[:buffer_newest_timekey]],
143
+ 'buffer_oldest_timekey' => [@metrics[:buffer_oldest_timekey]],
144
144
 
145
145
  # output metrics
146
- 'retry_count' => @metrics[:retry_counts],
146
+ 'retry_count' => [@metrics[:retry_counts], @metrics[:num_errors]],
147
147
  # Needed since Fluentd v1.14 due to metrics extensions.
148
- 'num_errors' => @metrics[:num_errors],
149
- 'write_count' => @metrics[:write_count],
150
- 'emit_count' => @metrics[:emit_count],
151
- 'emit_records' => @metrics[:emit_records],
152
- 'rollback_count' => @metrics[:rollback_count],
153
- 'flush_time_count' => @metrics[:flush_time_count],
154
- 'slow_flush_count' => @metrics[:slow_flush_count],
148
+ 'write_count' => [@metrics[:write_count]],
149
+ 'emit_count' => [@metrics[:emit_count]],
150
+ 'emit_records' => [@metrics[:emit_records]],
151
+ 'rollback_count' => [@metrics[:rollback_count]],
152
+ 'flush_time_count' => [@metrics[:flush_time_count]],
153
+ 'slow_flush_count' => [@metrics[:slow_flush_count]],
155
154
  }
156
155
  # No needed for Fluentd v1.14 but leave as-is for backward compatibility.
157
156
  instance_vars_info = {
@@ -167,12 +166,14 @@ module Fluent::Plugin
167
166
  agent_info.each do |info|
168
167
  label = labels(info)
169
168
 
170
- monitor_info.each do |name, metric|
171
- if info[name]
172
- if metric.is_a?(::Prometheus::Client::Gauge)
173
- metric.set(info[name], labels: label)
174
- elsif metric.is_a?(::Prometheus::Client::Counter)
175
- metric.increment(by: info[name] - metric.get(labels: label), labels: label)
169
+ monitor_info.each do |name, metrics|
170
+ metrics.each do |metric|
171
+ if info[name]
172
+ if metric.is_a?(::Prometheus::Client::Gauge)
173
+ metric.set(info[name], labels: label)
174
+ elsif metric.is_a?(::Prometheus::Client::Counter)
175
+ metric.increment(by: info[name] - metric.get(labels: label), labels: label)
176
+ end
176
177
  end
177
178
  end
178
179
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-prometheus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro Sano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-02 00:00:00.000000000 Z
11
+ date: 2022-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  - !ruby/object:Gem::Version
160
160
  version: '0'
161
161
  requirements: []
162
- rubygems_version: 3.2.22
162
+ rubygems_version: 3.3.7
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: A fluent plugin that collects metrics and exposes for Prometheus.