fluent / fluent-plugin-prometheus

A fluent plugin that collects metrics and exposes for Prometheus.
Apache License 2.0
258 stars 79 forks source link

prometheus output plugin not working for multi worker scenario #101

Open Nikunj-Sharma opened 5 years ago

Nikunj-Sharma commented 5 years ago

Hi there,

Thanks for this wonderful plugin. I am trying to get "The total number of outgoing records" in case of multi worker scenario. But it seems like prometheus output plugin doesn't support multiple worker.

Below is the match and system configuration I used(4 workers)


<system>
  workers 2
  root_dir /Users/snikunj/Desktop/td-agent/buffer
</system>
<match debug.**>
  @type copy

  <store>
    @type prometheus
    # @id out_prometheus
    <metric>
      name fluentd_output_status_num_records_total
      type counter
      desc The total number of outgoing records
      <labels>
        tag ${tag}
        hostname ${hostname}
      </labels>
    </metric>
  </store>
</match>  

Below is the error I am getting

[error]: config error file="/etc/td-agent/td-agent.conf" error_class=Fluent::ConfigError error="Plugin 'prometheus' does not support multi workers configuration (Fluent::Plugin::PrometheusOutput)"

Is there any way I can achieve my requirement? getting "The total number of outgoing records" in case of multi worker?

ganmacs commented 5 years ago

Please update to v1.4.0 which supports multi worker.

See also this PR https://github.com/fluent/fluent-plugin-prometheus/pull/82