Class: Fluent::Plugin::PrometheusFilter
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 PrometheusFilter.
12
13
14
15
|
# File 'lib/fluent/plugin/filter_prometheus.rb', line 12
def initialize
super
@registry = ::Prometheus::Client.registry
end
|
Instance Method Details
21
22
23
24
25
|
# File 'lib/fluent/plugin/filter_prometheus.rb', line 21
def configure(conf)
super
labels = parse_labels_elements(conf)
@metrics = Fluent::Plugin::Prometheus.parse_metrics_elements(conf, @registry, labels)
end
|
#filter(tag, time, record) ⇒ Object
38
39
40
41
|
# File 'lib/fluent/plugin/filter_prometheus.rb', line 38
def filter(tag, time, record)
instrument_single(tag, time, record, @metrics)
record
end
|
#multi_workers_ready? ⇒ Boolean
17
18
19
|
# File 'lib/fluent/plugin/filter_prometheus.rb', line 17
def multi_workers_ready?
true
end
|
#start ⇒ Object
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/fluent/plugin/filter_prometheus.rb', line 27
def start
super
Fluent::Plugin::Prometheus.start_retention_threads(
@metrics,
@registry,
method(:thread_create),
method(:thread_current_running?),
@log
)
end
|