Monitoring guide
RabbitMQ monitoring: queues, consumers and alarms
RabbitMQ trouble shows up as queues that keep growing. Watch depth, consumers and the broker’s memory and disk alarms, which block publishers when they fire.
4 min read13 sectionsUpdated
On this page
| Metric | Worry when |
|---|---|
| messages_ready per queue | Growing over time |
| messages_unacknowledged | High and not draining: consumers stuck |
| consumers per queue | 0 on queues that should be consumed |
| publish vs deliver/ack rate | Publish consistently higher |
| Memory and disk alarms | Any alarm (publishers are blocked) |
| Connection and channel churn | Thousands per minute: clients reconnecting in a loop |
Common fixes
- Set a sensible prefetch (
basic.qos) so one consumer does not hoard messages. - Add consumers, or make each faster; traces show where consumer time goes.
- Use dead-letter exchanges for messages that keep failing, instead of requeueing forever.
- Keep connections long-lived; open channels on them rather than reconnecting per message.
receivers:
rabbitmq:
endpoint: http://rabbitmq:15672
username: otel_monitor
password: ${env:RABBITMQ_MONITOR_PASSWORD}
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: [rabbitmq], exporters: [otlphttp/vitalrix] }RabbitMQ monitoring with VitalRix
Collector metrics arrive over OTLP and can be charted on dashboards and used in alert rules. A TCP check confirms RabbitMQ accepts connections from the network your app uses, and APM traces show which requests wait on RabbitMQ and for how long, from the client spans your instrumented services create. An HTTP check on the management API health endpoint can alert when the broker reports an alarm.
A backlog, explained
The emails queue grows from 0 to 40,000 in an hour while publish rate is normal. Consumers show 4 connected, messages_unacknowledged steady at 40 (prefetch 10 × 4). Consumer traces show each message waiting 8 seconds on the email provider's API, up from 200 ms. The broker is fine; a dependency slowed down. Adding consumers would only hammer the provider; the right fix is a timeout, retry with backoff and a status check on the provider.
The RabbitMQ metrics that matter
Enable the built-in Prometheus plugin (rabbitmq-plugins enable rabbitmq_prometheus, port 15692) or read the management API. Watch queues first: a broker can be perfectly healthy while one queue silently fills up.
| Metric | What it tells you | Starting alert |
|---|---|---|
| Messages ready per queue | Work waiting for consumers | Growing for 10 minutes, or above a size you choose per queue |
| Messages unacknowledged | Delivered but not yet acked | Rising while ready also rises: consumers are stuck |
| Consumers per queue | Who is reading | Zero on a queue that should always have consumers |
| Publish vs deliver rate | In vs out | Publish above deliver for 15 minutes |
| Memory and disk alarms | Broker flow control | Any alarm: publishers are being blocked |
| File descriptors and sockets | Connection capacity | Above 80% of the limit |
| Connection and channel churn | Clients opening and closing constantly | A sustained spike, usually a client bug |
# queues with backlog, unacked messages and consumer count
rabbitmqctl list_queues name messages_ready messages_unacknowledged consumers
# alarms and resource use on this node
rabbitmq-diagnostics status | grep -iE "alarm|memory|disk"What the incidents look like
- A growing backlog with zero consumers: a worker deployment failed or crashed in a loop. Alert on "no consumers" per critical queue.
- Unacked keeps rising: consumers take messages and never ack, often because a handler hangs. Set a prefetch limit and a per-message timeout in the consumer.
- Publishers blocked: the memory or disk alarm fired and RabbitMQ stopped accepting publishes. Producers see timeouts while the broker looks "up".
- Dead-letter queues filling quietly: messages are failing and nobody looks. Alert on their size like any other queue.
The end-to-end view matters more than any broker metric: trace a message from the publishing request through the consumer with distributed tracing, and you see where time goes when "the email arrived ten minutes late".
What triggers a memory alarm?
Memory use above vm_memory_high_watermark (by default a share of available RAM). Publishers are blocked until it drops.
Quorum or classic queues?
Quorum queues are the recommended replicated queue type for data safety; classic queues suit transient, non-replicated workloads.
Related reading
- RabbitMQ queue backlog: how to diagnose and clear it: Fix a growing RabbitMQ queue: tell slow consumers from unacked messages, tune prefetch, recover from memory alarms and protect queues with limits and DLQs.
- How to monitor Heroku: How to monitor apps on Heroku: H12 timeouts and other router errors, dyno memory (R14), response time, Postgres and Redis add-ons, uptime checks and alerts.
- HAProxy monitoring: backends, errors and queues: Monitor HAProxy: the stats page and Prometheus endpoint, backend server health, 5xx rates, queue length, session limits and response times, with alerts to set.
- Redis monitoring: metrics that matter: Monitor Redis with INFO: memory and evictions, hit rate, clients, latency, persistence and replication, with thresholds and the alerts to set.
- The three pillars of observability: Logs, metrics and traces compared: what each pillar of observability is good at, what it costs, and how to link them so one alert leads to the cause.
- AWS monitoring with CloudWatch metrics: Monitor AWS workloads: which CloudWatch metrics matter for EC2, RDS, ELB and SQS, the IAM permissions to read them and the alerts to set.
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.