Feature #10500
closedBuild HAProxy Package with buildin Prometheus exporter
100%
Description
Now if you try use in fronend:
http-request use-service prometheus-exporter if { path /metrics }
stats enable
stats uri /stats
stats refresh 10s
you will get error: error detected in frontend 'http-stats' while parsing 'http-request use-service' rule : 'prometheus-exporter' unknown service name.
Prometheus exporter is must have. For example Telegraf HAProxy exporter not give even half of info that Prometheus provide. Official post https://www.haproxy.com/blog/haproxy-exposes-a-prometheus-metrics-endpoint/ with explanation and build instructions.
Updated by DRago_Angel [InV@DER] over 4 years ago
This only apply for HAProxy 2.0 and higher*
Updated by Viktor Gurov over 4 years ago
Updated by Jim Pingle over 4 years ago
- Status changed from New to Pull Request Review
Updated by Viktor Gurov over 4 years ago
Updated by DRago_Angel [InV@DER] over 4 years ago
Hi @Viktor can I test it on my pfsense 2.4.5? And if yes - then how? I have System Patcher but doesn't know if it can change build stage. Thank you for help.
Updated by Kilian Ries over 4 years ago
I'm also interested in the haproxy prometheus exporter - if you need a tester just let me know...
Updated by DRago_Angel [InV@DER] over 4 years ago
Kilian Ries wrote:
I'm also interested in the haproxy prometheus exporter - if you need a tester just let me know...
This not a forum, sorry for offtopic, but till it not buildin you can try https://github.com/prometheus/haproxy_exporter I using it now, while waiting for buildin exporter. Maybe you already using it
Updated by Renato Botelho over 4 years ago
- Status changed from Pull Request Review to Feedback
- Assignee set to Renato Botelho
- % Done changed from 0 to 100
PR has been merged. Thanks!
Updated by DRago_Angel [InV@DER] over 4 years ago
Tested, build-in exporter works. Thank you.
Updated by Jim Pingle over 4 years ago
- Status changed from Feedback to Resolved
Updated by Viktor Gurov over 4 years ago
OK:
# haproxy -vv HA-Proxy version 2.0.14 2020/04/02 - https://haproxy.org/ Build options : TARGET = freebsd CPU = generic ... Built with the Prometheus exporter as a service ... Available services : prometheus-exporter
Updated by DRago_Angel [InV@DER] over 4 years ago
If someone need how-to, I wrote it here: https://www.reddit.com/r/PFSENSE/comments/gns3qr/haproxy_20_prometheus_monitoring/
Updated by Per-Arne Hellarvik almost 2 years ago
I want to reopen this. The service has disappeared:
# haproxy -vv HA-Proxy version 2.2.22-16420af 2022/03/14 - https://haproxy.org/ Status: long-term supported branch - will stop receiving fixes around Q2 2025. ... Available services : none ...
Updated by DRago_Angel [InV@DER] almost 2 years ago
Per-Arne Hellarvik wrote in #note-14:
I want to reopen this. The service has disappeared:
[...]
Just stop using old version, 2.2.22 is old. I don't know why pfsense devs choose to use develop for fresh LTS versions and non-develop naming for the seriously old LTS versions. It's confusing and I don't support this naming, instead they better name packages as haproxy-22, haproxy-24, haproxy-26 and for version of the package use UI build version, e.g.: haproxy-24 v1.0.5 as it done for Zabbix package already.
About USE_PROMEX, it's in place so this ticket should not be reopened:
HAProxy version 2.4.9-f8dcd9f 2021/11/24 - https://haproxy.org/
Status: long-term supported branch - will stop receiving fixes around Q2 2026.
Known bugs: http://www.haproxy.org/bugs/bugs-2.4.9.html
Running on: FreeBSD 12.3-STABLE FreeBSD 12.3-STABLE RELENG_2_6_0-n226742-1285d6d205f pfSense amd64
Build options :
TARGET = freebsd
CPU = generic
CC = cc
CFLAGS = -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -Wall -Wextra -Wdeclaration-after-statement -fwrapv -Wno-address-of-packed-member -Wno-unused-label -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wno-string-plus-int -Wtype-limits -Wshift-negative-value -Wnull-dereference -DFREEBSD_PORTS
OPTIONS = USE_PCRE=1 USE_PCRE_JIT=1 USE_STATIC_PCRE=1 USE_GETADDRINFO=1 USE_OPENSSL=1 USE_LUA=1 USE_ACCEPT4=1 USE_ZLIB=1 USE_CPU_AFFINITY=1 USE_PROMEX=1
DEBUG =
...
Available services : prometheus-exporter
...
P.s. minor version of both packages is really old - was updated last time at the end of 2021! HAproxy 2.2 version is already 2.2.29 and 2.4 is 2.4.22, both of them has fixed critical bug and in general even without critical bugs it's not okay to not maintain up to date version for so long. I not speaking about the critically old OpenSSL version which is part of it (1.1.1l) which has bunch of known CVEs: https://www.openssl.org/news/openssl-1.1.1-notes.html