fluent-plugin-prometheus 1.7.2 → 1.7.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: b8cdb0af95b316cebf86dba1a0beb649d51dca8ebcc2a9148c3a54341510037a
4
- data.tar.gz: 348dc37b2707ad5d272a2ad3ea8aba4f2188084fa359bdb1cacd4081467c1227
3
+ metadata.gz: 1f14f2b2162bace2a18a80f885df28261ed260a7b8e865a12e7828d46af9b02f
4
+ data.tar.gz: 20749cd6ee743ac3726719e654e1a4f046aa2f953245604e6aa75cd87ed00e62
5
5
  SHA512:
6
- metadata.gz: 0a014a3ff64dd13721e3c6c0a5b1bc9f7cccf7523cc1040944eeb40d74b9e8c45fa89e47fbf68f83ae968ef36bb19ef461be7cf346b407262e7457d8a38b6bc6
7
- data.tar.gz: 395ef53fcfd6d0c6619960dc69b249a4ebf44230c9348c5d688c901980dbcd1aba95f826003fd1a9fa37f22e15d4383b1f5757c6d49ebe1dcd524aca730044d3
6
+ metadata.gz: 28ca37140a4b634665a9ba184c1615380bc7c458ed745d5548cb75b92d75d3b1069cd342d3119785a11d1beb369e7b41b5fa0319021bb0f69400ffe327dea83e
7
+ data.tar.gz: b04770fec96856fc37b6943c7129c5e8ef16ce8b1415b425932e4419594e58a3255406de54e3aad1c28af1e3d62074391bd2b40e4aded8b5f598fbece53cab82
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "fluent-plugin-prometheus"
3
- spec.version = "1.7.2"
3
+ spec.version = "1.7.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.}
@@ -29,7 +29,7 @@ module Fluent::Plugin
29
29
  super
30
30
  hostname = Socket.gethostname
31
31
  expander_builder = Fluent::Plugin::Prometheus.placeholder_expander(log)
32
- expander = expander_builder.prepare_placeholders({ 'hostname' => hostname, 'worker_id' => fluentd_worker_id })
32
+ expander = expander_builder.build({ 'hostname' => hostname, 'worker_id' => fluentd_worker_id })
33
33
  @base_labels = parse_labels_elements(conf)
34
34
  @base_labels.each do |key, value|
35
35
  unless value.is_a?(String)
@@ -0,0 +1,42 @@
1
+ require 'spec_helper'
2
+ require 'fluent/plugin/in_prometheus_tail_monitor'
3
+ require 'fluent/test/driver/input'
4
+
5
+ describe Fluent::Plugin::PrometheusTailMonitorInput do
6
+ MONITOR_CONFIG = %[
7
+ @type prometheus_tail_monitor
8
+ <labels>
9
+ host ${hostname}
10
+ foo bar
11
+ </labels>
12
+ ]
13
+
14
+ INVALID_MONITOR_CONFIG = %[
15
+ @type prometheus_tail_monitor
16
+
17
+ <labels>
18
+ host ${hostname}
19
+ foo bar
20
+ invalid_use1 $.foo.bar
21
+ invalid_use2 $[0][1]
22
+ </labels>
23
+ ]
24
+
25
+ let(:config) { MONITOR_CONFIG }
26
+ let(:driver) { Fluent::Test::Driver::Input.new(Fluent::Plugin::PrometheusTailMonitorInput).configure(config) }
27
+
28
+ describe '#configure' do
29
+ describe 'valid' do
30
+ it 'does not raise error' do
31
+ expect { driver }.not_to raise_error
32
+ end
33
+ end
34
+
35
+ describe 'invalid' do
36
+ let(:config) { INVALID_MONITOR_CONFIG }
37
+ it 'expect raise error' do
38
+ expect { driver }.to raise_error
39
+ end
40
+ end
41
+ end
42
+ 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: 1.7.2
4
+ version: 1.7.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: 2020-02-13 00:00:00.000000000 Z
11
+ date: 2020-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -131,6 +131,7 @@ files:
131
131
  - spec/fluent/plugin/filter_prometheus_spec.rb
132
132
  - spec/fluent/plugin/in_prometheus_monitor_spec.rb
133
133
  - spec/fluent/plugin/in_prometheus_spec.rb
134
+ - spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
134
135
  - spec/fluent/plugin/out_prometheus_spec.rb
135
136
  - spec/fluent/plugin/prometheus/placeholder_expander_spec.rb
136
137
  - spec/fluent/plugin/prometheus_metrics_spec.rb
@@ -163,6 +164,7 @@ test_files:
163
164
  - spec/fluent/plugin/filter_prometheus_spec.rb
164
165
  - spec/fluent/plugin/in_prometheus_monitor_spec.rb
165
166
  - spec/fluent/plugin/in_prometheus_spec.rb
167
+ - spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
166
168
  - spec/fluent/plugin/out_prometheus_spec.rb
167
169
  - spec/fluent/plugin/prometheus/placeholder_expander_spec.rb
168
170
  - spec/fluent/plugin/prometheus_metrics_spec.rb