If you run HAProxy in multiprocess mode, your HTTP requests are probably load-balanced between the different processes. The stats are not shared between processes. So the value will differ between processes. Try to read the value of haproxy_process_relative_process_id
to know where a request was processed.
In nbproc
, you need to get stats from each process individually and aggregate the results. Prometheus can handle the aggregation, so you need to update your HAProxy configuration to have a listen socket bound on each process. Another solution is to use threads instead of processes. Note that the same is true for the stats socket.