fluent / fluent-plugin-prometheus

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

/aggregated_metrics doesn't work completely with v1.8.0 when async-http is bundled #159

Closed eagletmt closed 4 years ago

eagletmt commented 4 years ago
% bundle list
Gems included by the bundle:
  * async (1.26.2)
  * async-http (0.52.4)
  * async-io (1.30.0)
  * async-pool (0.3.2)
  * concurrent-ruby (1.1.6)
  * console (1.8.2)
  * cool.io (1.6.0)
  * fluent-plugin-prometheus (1.8.0)
  * fluentd (1.11.1)
  * http_parser.rb (0.6.0)
  * msgpack (1.3.3)
  * nio4r (2.5.2)
  * prometheus-client (0.9.0)
  * protocol-hpack (1.4.2)
  * protocol-http (0.20.0)
  * protocol-http1 (0.13.0)
  * protocol-http2 (0.14.0)
  * quantile (0.2.1)
  * serverengine (2.2.1)
  * sigdump (0.2.4)
  * strptime (0.2.4)
  * timers (4.3.0)
  * tzinfo (2.0.2)
  * tzinfo-data (1.2020.1)
  * yajl-ruby (1.4.1)
Use `bundle info` to print more detailed information about a gem
% bundle exec fluentd -c prometheus.conf
2020-07-03 14:29:00 +0900 [info]: parsing config file is succeeded path="prometheus.conf"
2020-07-03 14:29:00 +0900 [info]: gem 'fluentd' version '1.11.1'
2020-07-03 14:29:00 +0900 [info]: gem 'fluent-plugin-prometheus' version '1.8.0'
2020-07-03 14:29:00 +0900 [info]: using configuration file: <ROOT>
  <source>
    @type prometheus
    port 27224
  </source>
</ROOT>
2020-07-03 14:29:00 +0900 [info]: starting fluentd-1.11.1 pid=249703 ruby="2.7.1"
2020-07-03 14:29:00 +0900 [info]: spawn command to main:  cmdline=["/usr/share/rbenv/versions/2.7.1/bin/ruby", "-r/usr/share/rbenv/versions/2.7.1/lib/ruby/2.7.0/bundler/setup", "-Eascii-8bit:ascii-8bit", "/home/eagletmt/gems/ruby/2.7.0/bin/fluentd", "-c", "prometheus.conf", "--under-supervisor"]
2020-07-03 14:29:00 +0900 [info]: adding source type="prometheus"
2020-07-03 14:29:00 +0900 [info]: #0 starting fluentd worker pid=249736 ppid=249703 worker=0
2020-07-03 14:29:00 +0900 [info]: #0 fluentd worker is now running worker=0

Then curl -sf localhost:27224/aggregated_metrics doesn't return any response.

Note that the combination of fluentd v1.11.1 and fluent-plugin-prometheus v1.8.0 and async-http v0.52.4 is bundled in td-agent 4.0.0 package. https://twitter.com/repeatedly/status/1278836628497154049

ganmacs commented 4 years ago

Thank you for your report. I've confirmed it's a bug :bow: . https://github.com/fluent/fluent-plugin-prometheus/pull/161 should fix it

Houlistonm commented 4 years ago

Just wanted to advise that we're also seeing this bug in td-agent 3.8.0. Manually applied #161 in our development environment and tested successfully. Please consider a patch release for 3.8.1 soonest. Thank you.