Monitoring guide
HAProxy monitoring: backends, errors and queues
HAProxy knows the health of every backend and every request it forwards. Its stats tell you when servers go down, queues build and errors rise.
4 min read13 sectionsUpdated
On this page
| Metric | Worry when |
|---|---|
| Server status per backend | Any server DOWN; all servers DOWN is an outage |
| Current queue (qcur) | Above 0 for minutes |
| Sessions current vs limit | Near the limit |
| HTTP 5xx rate | Rising; check whether from backends or HAProxy itself |
| Response time (rtime) / total time (ttime) | Rising backend response time |
| Health check failures | Flapping servers |
receivers:
haproxy:
endpoint: http://127.0.0.1:8404/stats
collection_interval: 60s
exporters:
otlphttp/vitalrix:
encoding: json
metrics_endpoint: ${env:VITALRIX_API}/api/v1/metrics/otlp/v1/metrics
headers: { x-api-key: ${env:VITALRIX_KEY} }
service:
pipelines:
metrics: { receivers: [haproxy], exporters: [otlphttp/vitalrix] }HAProxy monitoring with VitalRix
Collector metrics arrive over OTLP and can be charted on dashboards and used in alert rules. A TCP check confirms HAProxy accepts connections from the network your app uses, and APM traces show which requests wait on HAProxy and for how long, from the client spans your instrumented services create. Uptime checks on the public URLs behind HAProxy confirm what users see. See 502 Bad Gateway and 503 Service Unavailable.
HAProxy logs and timers
HAProxy's HTTP log line includes timers (Tq/Tw/Tc/Tr/Ta): time to receive the request, time waiting in queue, time to connect to the server, server response time and total time, plus termination flags that say why a connection ended. High Tw means queueing; high Tc means trouble reaching servers; high Tr means slow backends. Ship the logs and chart these fields; they explain most slowdowns at a glance.
The HAProxy metrics that matter
HAProxy 2.0 and later can serve Prometheus metrics itself (http-request use-service prometheus-exporter on a stats frontend); older versions expose the stats page and the runtime socket.
| Metric | Stats field | Starting alert |
|---|---|---|
| Backend servers up | status per server | Any server DOWN; all servers down is an outage |
| Queued requests | qcur | Above zero for a minute: servers are at maxconn |
| Sessions vs limit | scur vs slim | Above 80% |
| 5xx responses | hrsp_5xx | Above 1% for 5 minutes |
| Retries and redispatches | wretr, wredis | A rising rate |
| Response time | rtime / ttime | Rising against the usual |
frontend stats
bind 127.0.0.1:8404
http-request use-service prometheus-exporter if { path /metrics }
stats enable
stats uri /stats
backend app
option httpchk GET /health
server app1 10.0.0.11:8080 check inter 5s fall 3 rise 2 maxconn 200What the incidents look like
- A health check that is too shallow: the check passes while the application returns errors, so HAProxy keeps sending traffic to a broken server. Make /health exercise the dependencies that matter.
- A check that is too strict: a slow database makes every server fail the check at once, and HAProxy takes the whole backend down. Separate liveness from deep checks.
- Queues build at maxconn during a spike, and response times climb before any error appears.
- Uneven load after a server is added, with sticky sessions keeping old clients on old servers.
Always pair load balancer metrics with an external uptime check: HAProxy reports its backends, not what users see.
Related reading
- The RED method: The RED method explained: rate, errors and duration for every service, how to compute each from traces, a dashboard layout and the alerts worth setting.
- WordPress monitoring: uptime, speed and errors: Monitor a WordPress site: uptime with content checks, login and admin, Core Web Vitals, PHP errors, plugin updates, SSL expiry and backups.
- RabbitMQ monitoring: queues, consumers and alarms: Monitor RabbitMQ: queue depth and message rates, unacknowledged messages, consumer counts, memory and disk alarms, and connection churn, with commands.
- Monitoring for game backends: Monitor game backends and launchers: login and matchmaking latency, store and payment APIs, regional performance, launch-day spikes.
- The Cloudflare outage of November 2025, explained: Why Cloudflare returned errors for hours on 18 November 2025: a permission change doubled a bot-management file past a limit, and the lessons.
- OpenTelemetry backends compared: Where to send OpenTelemetry data in 2026: open-source and commercial backends compared on OTLP support, views, cost and hosting, with criteria for choosing one.
Watch your own site and services with VitalRix
Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.