fluent-plugin-prometheus 1.1.0 → 1.2.0

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
- SHA256:
3
- metadata.gz: bc058ef050bbdee33044783899fc6af14b731d974cb5f2b827997683a82ddb85
4
- data.tar.gz: aef907fc671770e55a4fb1cad4de41b09c6a0b053b6fbcc5fbde8193d71faa0d
2
+ SHA1:
3
+ metadata.gz: da342f3a63fc1bb0e727eb1910c7b13734600dd2
4
+ data.tar.gz: 46ec363b48352bad9e781695d7358172f06fb5c0
5
5
  SHA512:
6
- metadata.gz: 4888508f00beb7f8654e7139f1d26962e1f3a2193b81a97b4f874a61d82ea759bde7f14558fba123565a01758478d6e30aad46937e7715bed8489099424579de
7
- data.tar.gz: ea29389ae6b63bf8a8f20124d7cd8651f88dbe45db66e40a74eecc2ce73762f400385ae73adf8074a2e8733cb132340233f282cb1d27aecfb627fbdd7e9bd468
6
+ metadata.gz: 771b4c6ee4ded81623869e6339b1f3ce56913a0042e82eeef210cba9825e3f0a5b6a2c071a884b7d4ad54e0689eaa4654f916cf797db4de7514dea21de2d2ee0
7
+ data.tar.gz: ca7cc8da3dd94f4b3976901f471cb1238813210109e0e05932f58991d353c8bd289ba2633144a1094f41ec14164ab3a04557a0f20ad0f6c07a5d99ad3f53553c
data/README.md CHANGED
@@ -341,6 +341,8 @@ All labels sections has same format. Each lines have key/value for label.
341
341
 
342
342
  You can use placeholder for label values. The placeholders will be expanded from records or reserved values. If you specify `${foo}`, it will be expanded by value of `foo` in record.
343
343
 
344
+ You can access nested fields in records via dot or bracket notation (https://docs.fluentd.org/v1.0/articles/api-plugin-helper-record_accessor#syntax), for example: `$.kubernetes.namespace`.
345
+
344
346
  Reserved placeholders are:
345
347
 
346
348
  - `${hostname}`: hostname
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "fluent-plugin-prometheus"
3
- spec.version = "1.1.0"
3
+ spec.version = "1.2.0"
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.}
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
14
14
  spec.require_paths = ["lib"]
15
15
 
16
- spec.add_dependency "fluentd", ">= 0.14.8", "< 2"
16
+ spec.add_dependency "fluentd", ">= 0.14.20", "< 2"
17
17
  spec.add_dependency "prometheus-client"
18
18
  spec.add_development_dependency "bundler"
19
19
  spec.add_development_dependency "rake"
@@ -17,7 +17,8 @@ module Fluent
17
17
  unless labels.empty?
18
18
  labels.first.each do |key, value|
19
19
  labels.first.has_key?(key)
20
- base_labels[key.to_sym] = value
20
+
21
+ base_labels[key.to_sym] = PluginHelper::RecordAccessor::Accessor.new(value)
21
22
  end
22
23
  end
23
24
 
@@ -101,7 +102,8 @@ module Fluent
101
102
  def labels(record, expander, placeholders)
102
103
  label = {}
103
104
  @base_labels.each do |k, v|
104
- label[k] = expander.expand(v, placeholders)
105
+ accessor_value = v.call(record)
106
+ label[k] = accessor_value.nil? ? expander.expand(v.keys, placeholders) : accessor_value
105
107
  end
106
108
  label
107
109
  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.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro Sano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-09 00:00:00.000000000 Z
11
+ date: 2018-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.14.8
19
+ version: 0.14.20
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.14.8
29
+ version: 0.14.20
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2'
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  requirements: []
153
153
  rubyforge_project:
154
- rubygems_version: 2.7.6
154
+ rubygems_version: 2.6.14.1
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: A fluent plugin that collects metrics and exposes for Prometheus.