Class: Fluent::Plugin::PrometheusOutput

Inherits:
Output
  • Object
show all
Includes:
Prometheus
Defined in:
lib/fluent/plugin/out_prometheus.rb

Instance Method Summary collapse

Methods included from Prometheus

#instrument, parse_labels_elements, parse_metrics_elements, placeholder_expander

Constructor Details

#initializePrometheusOutput

Returns a new instance of PrometheusOutput.



9
10
11
12
# File 'lib/fluent/plugin/out_prometheus.rb', line 9

def initialize
  super
  @registry = ::Prometheus::Client.registry
end

Instance Method Details

#configure(conf) ⇒ Object



18
19
20
21
22
# File 'lib/fluent/plugin/out_prometheus.rb', line 18

def configure(conf)
  super
  labels = Fluent::Plugin::Prometheus.parse_labels_elements(conf)
  @metrics = Fluent::Plugin::Prometheus.parse_metrics_elements(conf, @registry, labels)
end

#multi_workers_ready?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/fluent/plugin/out_prometheus.rb', line 14

def multi_workers_ready?
  true
end

#process(tag, es) ⇒ Object



24
25
26
# File 'lib/fluent/plugin/out_prometheus.rb', line 24

def process(tag, es)
  instrument(tag, es, @metrics)
end