Class: Fluent::PrometheusOutput
- Inherits:
-
Output
- Object
- Output
- Fluent::PrometheusOutput
- Includes:
- Prometheus
- Defined in:
- lib/fluent/plugin/out_prometheus.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #emit(tag, es, chain) ⇒ Object
-
#initialize ⇒ PrometheusOutput
constructor
A new instance of PrometheusOutput.
Methods included from Prometheus
#instrument, parse_labels_elements, parse_metrics_elements, placeholder_expnader
Constructor Details
#initialize ⇒ PrometheusOutput
Returns a new instance of PrometheusOutput.
8 9 10 11 |
# File 'lib/fluent/plugin/out_prometheus.rb', line 8 def initialize super @registry = ::Prometheus::Client.registry end |
Instance Method Details
#configure(conf) ⇒ Object
13 14 15 16 17 |
# File 'lib/fluent/plugin/out_prometheus.rb', line 13 def configure(conf) super labels = Fluent::Prometheus.parse_labels_elements(conf) @metrics = Fluent::Prometheus.parse_metrics_elements(conf, @registry, labels) end |
#emit(tag, es, chain) ⇒ Object
19 20 21 22 |
# File 'lib/fluent/plugin/out_prometheus.rb', line 19 def emit(tag, es, chain) instrument(tag, es, @metrics) chain.next end |