How to monitor RabbitMQ

Monitor RabbitMQ by checking that the node responds (rabbitmq-diagnostics ping) and has no memory or disk alarm, because an alarm blocks every publisher. Then watch ready and unacknowledged messages and the consumer count on the queues that matter. Vigil can read the management API's alarm health check directly and track queue depth with agent commands.

Updated · by PuzariCloud · commands checked against current releases

What can go wrong with RabbitMQ

  • Resource alarms block publishers. When memory use passes the high watermark or free disk drops below disk_free_limit (50 MB by default), RabbitMQ blocks all publishing connections. Producers hang rather than error.
  • No consumers. A consumer deploy failed and a queue has zero consumers; messages pile up until memory or disk alarms trigger.
  • Unacked messages pile up. A consumer receives messages and never acknowledges them (stuck handler, large prefetch). They are invisible to other consumers until the channel closes.
  • Network partition. In a cluster, a partition splits the nodes; depending on cluster_partition_handling some nodes pause or diverge.
  • File descriptors. Each connection needs a file descriptor; running out refuses new connections.

The signals that matter, with alert thresholds

SignalAlert whenWhy it matters
Node respondsping fails twiceDown.
Local alarmsany memory or disk alarmPublishers are blocked now.
messages_ready on key queues> a few minutes of throughputBacklog.
messages_unacknowledgedgrowing while ready stays flatStuck consumers.
Consumers on key queues0Nothing is processing.
Disk free on the node< 2 GB, well above the 50 MB default limitRoom before the disk alarm.

Thresholds are starting points. Tune them after a week of data: an alert nobody acts on should be raised or removed.

How to check RabbitMQ by hand

Node up and no alarms
sudo rabbitmq-diagnostics -q ping
sudo rabbitmq-diagnostics -q check_local_alarms
Queues with depth, unacked and consumers
sudo rabbitmqctl list_queues name messages_ready messages_unacknowledged consumers
Cluster members and partitions
sudo rabbitmq-diagnostics cluster_status
Alarm health check over HTTP (management plugin)
curl -s -u monitor:secret http://localhost:15672/api/health/checks/alarms

How to watch RabbitMQ with Vigil

  1. In New monitor create an App health monitor on http://rabbit.internal:15672/api/health/checks/alarms with an Authorization: Basic … header for a user with the monitoring tag. It answers {"status":"ok"}, or HTTP 503 with the alarm when one is in effect. Run it from a private location if the port is internal.
  2. Add the host under Servers and run the one-line installer it shows (curl -fsSL https://puzaricloud.in/install-server-agent.sh | sh -s -- --token <token>). The agent is one Python file with no dependencies; CPU, memory, disk, inode and load rules start working with the first report. Add rabbitmq-server to the systemd services to watch.
  3. Add queue depth and consumer commands for the queues that matter (below), with limits such as rabbit_orders_ready = 5000 and rabbit_orders_no_consumers = 1.
  4. With the rabbitmq_prometheus plugin enabled, you can instead add http://127.0.0.1:15692/metrics under Prometheus exporters to scrape and set limits on those series.
/etc/vigil-agent.json (queue 'orders')
{
  "commands": {
    "rabbit_orders_ready": "rabbitmqctl list_queues -q name messages_ready | awk '$1==\"orders\" {print $2}'",
    "rabbit_orders_no_consumers": "rabbitmqctl list_queues -q name consumers | awk '$1==\"orders\" {print ($2==0)}'"
  }
}

Every alert goes to the channels you pick: email, Slack, Telegram, Discord, Microsoft Teams, Pushover, webhooks or on-call paging. Failures are confirmed by a second check before anyone is woken up.

RabbitMQ monitoring FAQ

Why do my producers hang instead of failing?

That is how RabbitMQ applies back-pressure: during a memory or disk alarm it blocks publishing connections. Clients that support connection.blocked notifications can log it; monitoring the alarm tells you directly.

Which user should monitoring use?

A dedicated user with the monitoring tag and no permissions on vhosts that carry data. It can read the management API and health checks, not publish or consume.

Do I need the management plugin?

Not for the agent commands, which use rabbitmqctl. The HTTP alarm check and per-queue API need the management plugin; the Prometheus endpoint needs rabbitmq_prometheus.

Vigil by PuzariCloud

Watch RabbitMQ without stitching five tools together

Uptime and API checks, heartbeats, server and database metrics, traces, errors and logs in one place, with one incident and one alert when something breaks. Every feature is on every plan, including Free.