HAProxy community

Stats are not updated


Hi All,

I am seeing issue in our haproxy where backend http responses total stats are not getting updated for few backends. Its a random behavior. We haproxy running in pods and backends are periodically refreshed based on using confd. We use prometheus haproxy exporter to retrieve the stats.

Is there some sort of sampling in the backend http response totals metric? Any special case that it will not update the stats?



Are you perhaps using HAProxy with multiple processes (i.e. by setting nbproc)?

I’m asking because apparently the stats page is individual for each process, and if you don’t use the stats bind-process option, you’ll get the stats from a random process on each request.


No, we don’t have multiple processes. I think what is happening here is when confd is reloading config for haproxy process, it resets the stats. The randomness in the behavior is because confd will only reload haproxy config when there is difference between newly generated config and existing config.

Is there a way of preserving metrics on config reload?


Yes, the statistics are reset whenever the HAProxy process is restarted. (Perhaps even when “reloaded”?)

I’m not sure how to solve this, but you could take a look at server-state-file and load-server-state-from-file perhaps those are helpful in preserving statistics.


This should not be a problem: