fluent / fluent-plugin-prometheus

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

num_errors metric missing with fluentd 1.14 #195

Closed stevenjm closed 2 years ago

stevenjm commented 2 years ago

Since the metrics changes in fluentd 1.14 (https://github.com/fluent/fluent-plugin-prometheus/pull/191), the fluentd_output_status_num_errors metric is missing. To reproduce:

  1. Clone the https://github.com/fluent/fluentd repo.
  2. git checkout v1.14.0
  3. Gemfile.local
    gem "fluent-plugin-prometheus", "2.0.2"
  4. fluent.conf
    
    <source>
    @type tail
    @id in
    path in
    tag test
    read_from_head true
    <parse>
    @type none
    </parse>
    </source>

<match test.**> @type file @id out path out

@type prometheus

@type prometheus_output_monitor

5. `bundle install`
6. `bundle exec fluentd -c fluent.conf`
7. There is no `num_errors` metric...

$ curl -s http://127.0.0.1:24231/metrics | grep num_errors

TYPE fluentd_output_status_num_errors gauge

HELP fluentd_output_status_num_errors Current number of errors.

8. ... but the same metric is available under the old `retry_count` name.

$ curl -s http://127.0.0.1:24231/metrics | grep retry_count

TYPE fluentd_output_status_retry_count gauge

HELP fluentd_output_status_retry_count Current retry counts.

fluentd_output_status_retry_count{plugin_id="out",type="file"} 0.0


To confirm it works with previous versions:

1. `git checkout v1.13.3`
2. `bundle exec fluentd -c fluent.conf`
3.

$ curl -s http://127.0.0.1:24231/metrics | grep num_errors

TYPE fluentd_output_status_num_errors gauge

HELP fluentd_output_status_num_errors Current number of errors.

fluentd_output_status_num_errors{plugin_id="out",type="file"} 0.0