Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fluentd metrics are not sent to prometheus for workers other than 0 #194

Open
prashant407 opened this issue Nov 23, 2021 · 4 comments
Open

Comments

@prashant407
Copy link

Hi

We are using Multiple workers in our fluentd configuration. Please refer the below configuration

 <system>
   workers 3
 </system>
 <source>
   @type forward
   port 24224
 </source>
 <match test.*>
   @type elasticsearch
   host elasticsearch
   port 9200
 </match>
 <source>
  @type prometheus
 </source>
 <source>
   @type prometheus_output_monitor
   interval 10
   <labels>
 	host ${hostname}
   </labels>
 </source>  

For scraping the metrics we are using prometheus. But when we are checking for the metrics it is only showing for the worker_id='0'. Please refer to the below output.

[nodetest]# curl localhost:24231/metrics | grep fluentd_output_status_emit_records
100  4448  100  4448    0    # TYPE fluentd_output_status_emit_records gauge
# HELP fluentd_output_status_emit_records Current emit records.
fluentd_output_status_emit_records{host="test-fluentd-daemonset-d26ts",worker_id="0",plugin_id="object:13e86d0",type="elasticsearch"} 0.0

Could someone please explain why for other workers prometheus is not able to scrape the metrics?

@prashant407
Copy link
Author

I also tried to run http://localhost:24231/aggregated_metrics command for fetching the metrics from all workers as suggested When using multiple workers, each worker binds to port + fluent_worker_id. To scrape metrics from all workers at once, you can access http://localhost:24231/aggregated_metrics on the below link

https://github.com/fluent/fluent-plugin-prometheus.

But it is not giving the expected output. Could someone please help in fetching the metrics from all workers?

Thanks

@prashant407
Copy link
Author

any updates?

@Mohitj252
Copy link

I am also getting the same error, can anyone guide me how we can fix it.

@khrizar
Copy link

khrizar commented Aug 25, 2023

I am having a similiar issue. I have 7 workers, the individual /metrics works fine.
But, /aggretaed_metrics responded on the corresponding port but it gives me a timeout.
This is the configuration :

<system>
  workers 7
</system>

<source>
  @type forward
</source>

<source>
  @type monitor_agent
  bind 127.0.0.1
  port 24220
</source>

<source>
  @type prometheus
  bind 127.0.0.1
  port 24240
  aggregated_metrics_path /aggregated_metrics
</source>

<source>
  @type prometheus_monitor
</source>

<source>
  @type prometheus_output_monitor
</source>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants