I have set stats to pull out monitoring result from socket file(instead of csv), and
everything is OK unless I continuously soft reload haproxy(kill -USR2 1).
I set master-worker mode and expose-fd listeners like this.
(stats socket /run/haproxy/admin1.sock mode 666 level admin expose-fd listeners process 1)
When I try soft reloading HAproxy, HAproxy shows great performance without any dropping packets. However, at that time, I see the loss of stats graph(I’m using separate monitoring agent like prometheus + grafana)
Not sure what exactly “loss of stats graph” is, but it definitely is a consequence. What does that mean exactly and what is the actual haproxy behavior that is causing this consequence?
Meaning a single reload does not cause whatever you mean by “loss of stats graph”?
Hey there,
yes, HA-Proxy drops the stats after reloading. I wish it didn’t but that is currently how it works. You can save the current state (availability) in a file when reloading - however, that does not save the stats either. Right now, to my knowledge, there is no way with HA-Proxy to keep the stats. What I currently do is - when reloading haproxy - to save the stats in a file, see: https://makandracards.com/makandra/36727-get-haproxy-stats-informations-via-socat
cheers
Ok, so it is about stats resetting on a single reload, which is indeed expected behavior.
You have to handle that in whatever application reads from the stats socket; when it detects an overflow (value decremented when compared to the last read), it should handle it appropriately.