rfmoz / grafana-dashboards

Grafana dashboards
Apache License 2.0
1.1k stars 438 forks source link

How to configure HAProxy to collect data from remote host #127

Closed mentax007 closed 4 months ago

mentax007 commented 1 year ago

Hi. i'm new with promitheus and grafana. Could somebody explain where I need to configure port/url to be able to collect data from haproxy server?

gqdc commented 8 months ago

Hello, from the HAProxy documentation : https://www.haproxy.com/blog/haproxy-exposes-a-prometheus-metrics-endpoint#configuring-haproxy

Add this frontend :

frontend stats
   bind *:8404
   option http-use-htx
   http-request use-service prometheus-exporter if { path /metrics }
   stats enable
   stats uri /stats
   stats refresh 10s

Restart HAProxy, and voilà