Class: Fluent::Plugin::PrometheusOutput
Instance Method Summary
collapse
Methods included from Prometheus
#instrument, #instrument_single, parse_labels_elements, parse_metrics_elements, placeholder_expander, start_retention_threads, #stringify_keys
#parse_labels_elements
Constructor Details
Returns a new instance of PrometheusOutput.
12
13
14
15
|
# File 'lib/fluent/plugin/out_prometheus.rb', line 12
def initialize
super
@registry = ::Prometheus::Client.registry
end
|
Instance Method Details
21
22
23
24
25
|
# File 'lib/fluent/plugin/out_prometheus.rb', line 21
def configure(conf)
super
labels = parse_labels_elements(conf)
@metrics = Fluent::Plugin::Prometheus.parse_metrics_elements(conf, @registry, labels)
end
|
#multi_workers_ready? ⇒ Boolean
17
18
19
|
# File 'lib/fluent/plugin/out_prometheus.rb', line 17
def multi_workers_ready?
true
end
|
#process(tag, es) ⇒ Object
38
39
40
|
# File 'lib/fluent/plugin/out_prometheus.rb', line 38
def process(tag, es)
instrument(tag, es, @metrics)
end
|
#start ⇒ Object
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/fluent/plugin/out_prometheus.rb', line 27
def start
super
Fluent::Plugin::Prometheus.start_retention_threads(
@metrics,
@registry,
method(:thread_create),
method(:thread_current_running?),
@log
)
end
|