fluent-plugin-prometheus 2.0.2 → 2.0.3
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/.github/workflows/linux.yml +5 -3
- data/ChangeLog +4 -0
- data/fluent-plugin-prometheus.gemspec +1 -1
- data/lib/fluent/plugin/in_prometheus_output_monitor.rb +23 -22
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21b4b3d81d41fadb057a133293f2629b39961faaadcb7caebbd885c10ed344d1
|
4
|
+
data.tar.gz: dbd8aa719306aa164f373c781f568b82bee27fc44bfc88e86c4ea5d31c5ce545
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca73efb455416a5e7c022793c17ae088cd685f5751e3497a501f9af880a5f9e970dd838c939d3b61e9145c92e2a0d3acff3d61fbde35a88c7f29e52b148de5c4
|
7
|
+
data.tar.gz: 9feaab5d5b45e6e9cb1bd48ea3bc47381db6c9cc806e4782fab18df21b093f4034ca8215202e32f64cd776ea695a385f195b3b02ab22679e8b3c01b97b2bd27c
|
data/.github/workflows/linux.yml
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
name: linux
|
2
2
|
on:
|
3
|
-
|
4
|
-
|
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: [ '
|
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,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "fluent-plugin-prometheus"
|
3
|
-
spec.version = "2.0.
|
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
|
-
'
|
149
|
-
'
|
150
|
-
'
|
151
|
-
'
|
152
|
-
'
|
153
|
-
'
|
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,
|
171
|
-
|
172
|
-
if
|
173
|
-
metric.
|
174
|
-
|
175
|
-
|
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.
|
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:
|
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.
|
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.
|