Living in a AI World….

How to setup Prometheus Exporter for HAProxy

Last reviewed: July 5, 2026. Applies to: HAProxy native Prometheus exporter configuration. Currentness note: Commands and screenshots are retained for the documented environment. Before production use, verify package names, image tags, cloud-provider UI labels, and plugin versions against your current platform.

As of 2.0.0, HAProxy includes a Prometheus exporter module that can be built into your binary during build time.

To build with the official Prometheus exporter module, make with the following EXTRA_OBJS flag:

make TARGET=linux-glibc EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"

Once built, you can enable and configure the Prometheus endpoint from your haproxy.cfg file as a typical 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

Put the configuration above in the HAProxy configuration file and then restart the HAProxy service and then go to the following URL

http://<Ip-address>:8404/metrcs
HAProxy Prometheus exporter metrics endpoint output

Do you have any question, suggestion, or a correction? Do let me know at [email protected]



Follow

Instagram / LinkedIn