Sha256: ac587c26ee5a2f40de32f04c5f4a3a49d9da6f5e244a783c91dd88491716e49f

Contents?: true

Size: 566 Bytes

Versions: 7

Compression:

Stored size: 566 Bytes

Contents

require 'fluent/output'
require 'fluent/plugin/prometheus'

module Fluent
  class PrometheusOutput < Output
    Plugin.register_output('prometheus', self)
    include Fluent::Prometheus

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

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

    def emit(tag, es, chain)
      instrument(tag, es, @metrics)
      chain.next
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
fluent-plugin-prometheus-0.5.0 lib/fluent/plugin/out_prometheus.rb
fluent-plugin-prometheus-0.4.0 lib/fluent/plugin/out_prometheus.rb
fluent-plugin-prometheus-0.3.0 lib/fluent/plugin/out_prometheus.rb
fluent-plugin-prometheus-0.2.1 lib/fluent/plugin/out_prometheus.rb
fluent-plugin-prometheus-0.2.0 lib/fluent/plugin/out_prometheus.rb
fluent-plugin-prometheus-thread-0.1.3 lib/fluent/plugin/out_prometheus.rb
fluent-plugin-prometheus-0.1.3 lib/fluent/plugin/out_prometheus.rb