HAProxy plugin with prometheus exporter enabled

Started by svs, May 18, 2021, 06:28:38 PM

Previous topic - Next topic
I'm somewhat new to OPNsense. I am trying to use prometheus to collect metrics from HAProxy. Unfortunately, the default haproxy plugin does not have the built-in prometheus exporter enabled, as described in https://github.com/haproxy/haproxy/tree/master/addons/promex .

Is there a version of the haproxy plugin with promex enabled that I can use?
Thanks!


Hi there,

your ticket has been closed. Is the promex now build into HAProxy? And if so how did you configure it as there seams to be no GUI for it?

Henning

Updated to v21.7.1 and confirm the HAProxy built-in Prometheus exporter (promex) is working well now.

You can find a description how to set this up here:
https://www.haproxy.com/blog/haproxy-exposes-a-prometheus-metrics-endpoint/#configuring-prometheus
https://forum.netgate.com/topic/153766/haproxy-2-0-prometheus-monitoring-how-to

I added a Public Service through the GUI, which resulted in this config:
# Frontend: Prometheus (Prometheus metrics exporter)
frontend Prometheus
    bind *:9105 name *:9105
    mode http
    option http-keep-alive
    # tuning options
    maxconn 10
    timeout client 30s

    # logging options
    option dontlog-normal
    # WARNING: pass through options below this line
    option http-use-htx
    http-request use-service  prometheus-exporter if { path /metrics }


Hope it helps!