fluent-plugin-prometheus 0.1.2 → 0.1.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
  SHA1:
3
- metadata.gz: 2e788403193d1cee84b22745fc1df7daff846687
4
- data.tar.gz: 2daaa89406fd5fdfd40af646e0710f0f852b4a9e
3
+ metadata.gz: 2697668d79174be33f93db6777808ba2e4b6e856
4
+ data.tar.gz: 9a842e147273f306bd2b7d18fbf6f2ca35ba3de9
5
5
  SHA512:
6
- metadata.gz: b74333d759e146f0ca7c0ab6a6457cefa771f6018fbdd5f20dcae0ac13d74b0ce4b028791ee9045124abe9a9d243a900f341538797b774e56426223e9f66c4d5
7
- data.tar.gz: 438a688500a58fd8084b4401987ff192c551405cda063838221041cdfe632db6ea6641aac0ca9a48e5420a9adcfc42837cd117e039f1e05f07558b176114bbce
6
+ metadata.gz: f25473b6467b07dcc4e25ca95696abb22aa2c1bafaf44707ba07bae3ae5d0f3bf89c6cbe62dc57858630bfcab9e2bf85b13d3d7f0423e9ed8dbd504bca33ed1e
7
+ data.tar.gz: 90a812f445c0b53189119ffe6e62d7eba8541528ace398c1caaebcf991c961ffa063ae440d338614559f436a0a619a9e1ac994f5270bcea0cfed74b3069398ed
data/.gitignore CHANGED
@@ -2,6 +2,7 @@
2
2
  /.yardoc
3
3
  /Gemfile.lock
4
4
  /Gemfile.fluentd.0.10.lock
5
+ /Gemfile.fluentd.0.12.lock
5
6
  /_yardoc/
6
7
  /coverage/
7
8
  /doc/
data/.travis.yml CHANGED
@@ -1,13 +1,13 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.1
5
4
  - 2.2
6
- - 2.3.0
5
+ - 2.3.1
7
6
 
8
7
  gemfile:
9
8
  - Gemfile
10
9
  - Gemfile.fluentd.0.10
10
+ - Gemfile.fluentd.0.12
11
11
 
12
12
  script:
13
13
  - bundle exec rake spec
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org/'
2
+ gem 'fluentd', '~> 0.12.0'
3
+ gemspec
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  A fluent plugin that instruments metrics from records and exposes them via web interface. Intended to be used together with a [Prometheus server](https://github.com/prometheus/prometheus).
6
6
 
7
- If you are using Fluentd v0.10, you have to explicitly install [fluent-plugin-record-reformer](https://github.com/sonots/fluent-plugin-record-reformer) together. With Fluentd v0.12, there is no additional dependency.
7
+ If you are using Fluentd v0.10, you have to explicitly install [fluent-plugin-record-reformer](https://github.com/sonots/fluent-plugin-record-reformer) together. With Fluentd v0.12 or v0.14, there is no additional dependency.
8
8
 
9
9
  ## Installation
10
10
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "fluent-plugin-prometheus"
3
- spec.version = "0.1.2"
3
+ spec.version = "0.1.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.}
@@ -1,3 +1,4 @@
1
+ require 'fluent/input'
1
2
  require 'fluent/plugin/prometheus'
2
3
  require 'webrick'
3
4
 
@@ -1,3 +1,5 @@
1
+ require 'fluent/input'
2
+ require 'fluent/plugin/in_monitor_agent'
1
3
  require 'fluent/plugin/prometheus'
2
4
  require 'webrick'
3
5
 
@@ -16,21 +18,21 @@ module Fluent
16
18
  def configure(conf)
17
19
  super
18
20
  hostname = Socket.gethostname
19
- expander = Fluent::Prometheus.placeholder_expnader(log)
21
+ expander = Fluent::Prometheus.placeholder_expander(log)
20
22
  placeholders = expander.prepare_placeholders({'hostname' => hostname})
21
23
  @base_labels = Fluent::Prometheus.parse_labels_elements(conf)
22
24
  @base_labels.each do |key, value|
23
25
  @base_labels[key] = expander.expand(value, placeholders)
24
26
  end
25
27
 
26
- @monitor_agent = MonitorAgentInput.new
28
+ @monitor_agent = Fluent::MonitorAgentInput.new
27
29
 
28
30
  buffer_queue_length = @registry.gauge(
29
31
  :fluentd_status_buffer_queue_length,
30
32
  'Current buffer queue length.')
31
33
  buffer_total_queued_size = @registry.gauge(
32
34
  :fluentd_status_buffer_total_bytes,
33
- 'Current total size of ququed buffers.')
35
+ 'Current total size of queued buffers.')
34
36
  retry_counts = @registry.gauge(
35
37
  :fluentd_status_retry_count,
36
38
  'Current retry counts.')
@@ -1,3 +1,4 @@
1
+ require 'fluent/output'
1
2
  require 'fluent/plugin/prometheus'
2
3
 
3
4
  module Fluent
@@ -41,7 +41,7 @@ module Fluent
41
41
  metrics
42
42
  end
43
43
 
44
- def self.placeholder_expnader(log)
44
+ def self.placeholder_expander(log)
45
45
  # Use internal class in order to expand placeholder
46
46
  if defined?(Fluent::Filter) # for v0.12, built-in PlaceholderExpander
47
47
  begin
@@ -62,7 +62,7 @@ module Fluent
62
62
 
63
63
  def configure(conf)
64
64
  super
65
- @placeholder_expander = Fluent::Prometheus.placeholder_expnader(log)
65
+ @placeholder_expander = Fluent::Prometheus.placeholder_expander(log)
66
66
  @hostname = Socket.gethostname
67
67
  end
68
68
 
@@ -2,12 +2,12 @@
2
2
 
3
3
  # input plugin that exports metrics
4
4
  <source>
5
- type prometheus
5
+ @type prometheus
6
6
  </source>
7
7
 
8
8
  # input plugin that collects metrics from MonitorAgent
9
9
  <source>
10
- type prometheus_monitor
10
+ @type prometheus_monitor
11
11
  <labels>
12
12
  host ${hostname}
13
13
  </labels>
@@ -16,7 +16,7 @@
16
16
  ## Nginx Access Log Configuration
17
17
 
18
18
  <source>
19
- type tail
19
+ @type tail
20
20
  format nginx
21
21
  tag nginx
22
22
  path /var/log/nginx/access.log
@@ -25,7 +25,7 @@
25
25
  </source>
26
26
 
27
27
  <filter nginx>
28
- type prometheus
28
+ @type prometheus
29
29
 
30
30
  # You can use counter type with specifying a key,
31
31
  # and increments counter by the value
@@ -52,11 +52,11 @@
52
52
  </filter>
53
53
 
54
54
  <match nginx>
55
- type copy
55
+ @type copy
56
56
  # for MonitorAgent sample
57
57
  # <store>
58
58
  # @id test_forward
59
- # type forward
59
+ # @type forward
60
60
  # buffer_type memory
61
61
  # <server>
62
62
  # host 127.0.0.1
@@ -64,14 +64,14 @@
64
64
  # </server>
65
65
  # </store>
66
66
  <store>
67
- type stdout
67
+ @type stdout
68
68
  </store>
69
69
  </match>
70
70
 
71
71
  ## Nginx Proxy Log Configuration
72
72
 
73
73
  <source>
74
- type tail
74
+ @type tail
75
75
  format ltsv
76
76
  tag nginx_proxy
77
77
  path /var/log/nginx/access_proxy.log
@@ -80,7 +80,7 @@
80
80
  </source>
81
81
 
82
82
  <filter nginx_proxy>
83
- type prometheus
83
+ @type prometheus
84
84
 
85
85
  # common labels for all metrics
86
86
  <labels>
@@ -128,8 +128,8 @@
128
128
  </filter>
129
129
 
130
130
  <match nginx_proxy>
131
- type copy
131
+ @type copy
132
132
  <store>
133
- type stdout
133
+ @type stdout
134
134
  </store>
135
135
  </match>
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: 0.1.2
4
+ version: 0.1.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: 2016-04-10 00:00:00.000000000 Z
11
+ date: 2016-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -106,6 +106,7 @@ files:
106
106
  - ".travis.yml"
107
107
  - Gemfile
108
108
  - Gemfile.fluentd.0.10
109
+ - Gemfile.fluentd.0.12
109
110
  - LICENSE.txt
110
111
  - README.md
111
112
  - Rakefile