So i tried to fix the issue using stats from sockets and manage to patch haproxy_export.go by myself (never play with Go before)
And I get It!
First step use one socket per proc
in my haproxy.conf :
global
nbproc 4
stats socket /var/run/haproxy.1 mode 600 level admin process 1
stats socket /var/run/haproxy.2 mode 600 level admin process 2
stats socket /var/run/haproxy.3 mode 600 level admin process 3
stats socket /var/run/haproxy.4 mode 600 level admin process 4
if you do
echo "show stat" |socat /var/run/haproxy.1 stdio
you get stats for proc 1 only, exactly the same as http://localhost/haproxy;csv
in my fix, i add a flag "socket" which can be set more than once
./haproxy_exporter2 -socket /var/run/haproxy.1 -socket /var/run/haproxy.2 -socket /var/run/haproxy.3 -socket /var/run/haproxy.4
the metrics are labeled with the pid (process ID) which give something like this
haproxy_backend_bytes_in_total{backend="prod",pid="1"} 34624
haproxy_backend_bytes_in_total{backend="prod",pid="2"} 116653
haproxy_backend_bytes_in_total{backend="prod",pid="3"} 105333
haproxy_backend_bytes_in_total{backend="prod",pid="4"} 37046
I'm new in Go, so my patch would be review for sure, but seems to work
If you are interested i can share it.
David.
I am having the same issue. Could I get a copy of your patch / fix along with any instructions you deem pertinent? Possibly a copy of your conf as well.
Thanks a ton,
Lester...@echostar.com