Monitoring
The metrics that matter, the built-in Prometheus endpoint, and alerts
RabbitMQ ships a Prometheus endpoint in the core distribution
(rabbitmq_prometheus, port 15692). No exporter needed. The
Prometheus & Grafana stack scrapes all three nodes
as job rabbitmq and provisions a RabbitMQ Overview dashboard.
curl -s localhost:15692/metrics | grep -c '^rabbitmq_' # ~380 aggregated series per node
cd ../prometheus && docker compose -f compose_prod.yaml up -d
open http://localhost:3001 # Dashboards -> Messaging -> RabbitMQ OverviewBy default the endpoint returns aggregated metrics (totals per node), so
cardinality stays small however many queues you have. /metrics/detailed
(and prometheus.return_per_object_metrics = true) adds per-queue series,
which is useful, and expensive with thousands of queues.
The signals that matter
| Signal | Query | Watch for |
|---|---|---|
| Node up | up{job="rabbitmq"} | Any 0 |
| Resource alarms | rabbitmq_alarms_memory_used_watermark, rabbitmq_alarms_free_disk_space_watermark | Any 1: every publisher is blocked |
| Backlog | sum(rabbitmq_queue_messages_ready) | Growing steadily |
| In flight | sum(rabbitmq_queue_messages_unacked) | High relative to consumers × prefetch: slow or stuck consumers |
| Flow | rate(rabbitmq_global_messages_received_total[5m]) vs ..._delivered_total and ..._acknowledged_total | Published > acked for a long time |
| Redeliveries | rate(rabbitmq_global_messages_redelivered_total[5m]) | A steady rate: crashing consumers or a poison message |
| Dead letters | rate(rabbitmq_global_messages_dead_lettered_*_total[5m]) | Any, by reason |
| Unroutable | rate(rabbitmq_global_messages_unroutable_dropped_total[5m]) | Any: messages silently lost |
| Churn | rate(rabbitmq_connections_opened_total[5m]) | High: clients connecting per message |
| Resources | rabbitmq_process_resident_memory_bytes vs rabbitmq_resident_memory_limit_bytes; rabbitmq_disk_space_available_bytes | Approaching the limits |
| Raft | rabbitmq_raft_commit_latency_seconds | Rising: replicas or disks are slow |
These map to the alerts in prometheus/config/rules/alerts.yml:
RabbitMQNodeDown, RabbitMQResourceAlarm, RabbitMQMessagesPilingUp,
RabbitMQDeadLettering, and RabbitMQUnroutableMessages.
Queue counts like rabbitmq_queue_messages_ready are reported by the
node that hosts each queue's leader, so sum by (node) shows where
queue leaders (and their load) live, not where clients connect. After a
failover, a node's queue depth can jump to zero while another's jumps up:
leaders moved, the messages didn't vanish.
Health checks
For load balancers and orchestrators, use rabbitmq-diagnostics checks
rather than "is the port open":
rabbitmq-diagnostics -q check_running
rabbitmq-diagnostics -q check_local_alarms
rabbitmq-diagnostics -q check_port_connectivity # what this stack's compose healthcheck uses
rabbitmq-diagnostics -q check_virtual_hostsDon't use check_local_alarms as a liveness probe. A node in a
memory alarm is alive and needs consumers to drain it. If Kubernetes
restarts it because the probe fails, the backlog moves to another node,
which alarms too, and the cluster restarts itself in a loop.
Lab
- Start the Prometheus stack, open RabbitMQ Overview, and run
work_queue.pyandreliability.py. Find the publish and ack spikes. - Trigger the memory alarm (see Flow Control)
and watch Resource alarms and the
RabbitMQResourceAlarmalert. - Run
dead_letters.pyand find each dead-letter reason on the dashboard. - Publish to an exchange with an unmatched key in a loop and watch the unroutable panel and alert.