RabbitMQ Monitoring: Diagnose Queue Backlogs and Stalled Consumers

Learn how to read RabbitMQ queue depth, ready and unacked messages, and consumer counts to diagnose a backlog and estimate when it will drain.

RabbitMQ Monitoring: Diagnose Queue Backlogs and Stalled Consumers

Your RabbitMQ queue is growing. Before adding workers, check three numbers for the same queue and time window: ready messages, unacknowledged messages and consumer count. They’ll help you tell whether work is waiting to be picked up, stuck in a worker, or arriving faster than the workers can finish it.

Read ready and unacked messages separately

  • Ready is rising and there are no consumers: Check whether the worker is running and registered on the expected queue and virtual host. Look for a failed rollout or a reconnect that restored the connection but not the subscription.
  • Unacked is rising while acknowledgements slow: Workers have received messages but haven’t finished processing them, or haven’t acknowledged them. Check worker logs, downstream latency and prefetch before raising concurrency.
  • Ready is rising while acknowledgements continue: Compare the queue’s incoming rate with its delivery and completion rates. Work may be getting done, just not fast enough to offset arrivals.

Look at the trend rather than one point. RabbitMQ’s consumer guide explains registration, acknowledgements and prefetch.

Find out what changed when the queue stopped draining

Mark when deliveries or acknowledgements first dropped. Compare that time with worker restarts, deployment events and broker connection changes. On Kubernetes, check whether a worker was OOM-killed, scaled down or never became healthy after a rollout. If several queues stall at once, check broker nodes and memory or disk alarms as well. A resource alarm can block publishers; it’s a separate signal from a missing consumer.

WatchLog can suggest a likely lost consumer by matching the drop in consumer count to a workload whose broker connection ended around the same time. That is a lead, not proof: the metrics and connection data WatchLog uses don’t establish which workload subscribed to a specific queue. Confirm the subscription in the worker’s configuration or startup logs before making changes.

Estimate how long the ready backlog will take to drain

Divide ready messages by the net drain rate, and only do it while the queue is shrinking. If a queue has 12,000 ready messages, receives 100 per second and delivers 150 per second, it drains the ready backlog in about four minutes at that pace, assuming requeues don’t materially change the rate. Check acknowledgements too: an empty ready queue doesn’t mean the workers have finished if unacked messages are still high. If the incoming rate matches or exceeds the outgoing rate, there’s no finite drain estimate at the current pace. This calculation doesn’t apply to retained messages in a RabbitMQ stream.

Set up RabbitMQ monitoring on Kubernetes, Docker or Linux

  1. Install the WatchLog agent on your cluster or server.
  2. In Applications, select RabbitMQ and click Monitor. WatchLog supports RabbitMQ 3.10 and later and reads broker metrics through rabbitmq_prometheus, which uses port 15692 by default.
  3. If a node is missing metrics, check that the plugin is enabled there and that the collector can reach its metrics endpoint. Follow the RabbitMQ setup guide for your deployment. Keep the metrics endpoint off the public internet.

WatchLog doesn’t need the management API and doesn’t read message bodies. Workload names and connection history depend on network-flow visibility; the broker’s queue metrics are useful even when that visibility isn’t available.

Alert on stalled work, not just queue size

Start with three rules: a queue that keeps growing with no consumers, sustained growth while consumers are active, and a node entering a memory or disk alarm. Add a high-unacked rule where it points to stuck work rather than a normal batch. Pick thresholds for the queue’s own traffic and use a separate rule for dead-letter queues, which may intentionally have no consumers.

See WatchLog’s RabbitMQ dashboard for the queue, client and node views, or open the live demo.