Back to blogguides

Monitor RabbitMQ before the queue backs up

3 min read

RabbitMQ breaks in two ways that look nothing alike. The loud one: the broker dies, producers start throwing connection errors, somebody notices. The quiet one: the broker stays perfectly healthy while a queue fills up because a consumer stalled or never reconnected after a deploy. The first monitoring layer has to catch the loud case reliably. The quiet case is a different problem and pretending one check covers both is how incidents reach the morning standup.

What a RabbitMQ health check should prove

A TCP port check tells you something is listening on 5672. It does not tell you that something is RabbitMQ. Misrouted traffic, a stale firewall rule pointing the port at the wrong container, a half-configured reverse proxy: all of these pass a port check while the broker is unreachable.

A proper check goes one step further and speaks the first bytes of the protocol. Connect, send the AMQP protocol header, and a real broker answers with a connection.start frame. That exchange proves the port is open and the thing behind it is actually an AMQP broker, in one round trip.

How the Uptriva check works

RabbitMQ almost never sits on a public address, and it should not. That is why the RabbitMQ monitor type runs on the internal agent instead of the global probe network. The agent runs wherever your broker is reachable: same VPC, same Kubernetes cluster, same Docker network.

Each check does the handshake described above against your target, defaults to port 5672, and reports status plus latency. A broker that accepts the connection but responds with something that is not an AMQP frame still gets flagged, which is exactly the case a plain port check misses.

Setting it up is three steps:

  1. Deploy the agent where it can reach the broker. If you already run one for server metrics, reuse it.
  2. Create a monitor, choose the RabbitMQ type, point it at broker-hostname:5672.
  3. Route alerts to wherever someone reads them. Escalation policies and on-call schedules work the same as for any other monitor.

Kafka and MQTT brokers get the same treatment: protocol handshake from the agent, on 9092 and 1883 respectively.

What the check does not catch

The handshake proves the broker is alive and speaking AMQP. It says nothing about what is happening inside it. The failures that hurt most usually live there:

  • Queue depth growing while the broker looks fine
  • Messages piling up unacked because a consumer is stuck
  • Node memory or disk alarms from vm_memory_high_watermark or disk_free_limit
  • Consumers that disconnected and never came back
  • Cluster partitions in multi-node setups

If the broker runs the management plugin, point an HTTP monitor at http://broker:15672/api/healthchecks/node and you get node-level health for free. For the queues themselves, the honest answer is that your application knows the expected drain rate better than any external check. A heartbeat monitor on the consumer job, or an alert on the metrics you already export, catches the stalled-consumer case that no broker-level check can see.

Keep the layers separate

External probes for the public edge, an agent for the broker, application signals for the queues. Each layer reports a different kind of dead, and merging them into one boolean is how a full queue hides behind a green broker check.

The RabbitMQ check type is available from the Team plan. See /monitoring/rabbitmq for the check details, or the monitors docs for alert configuration.

FAQ

How do you monitor RabbitMQ?

Check two different things: whether the broker accepts AMQP connections on port 5672, and whether queues are draining. A protocol-level check from an internal agent covers the first. Queue depth, unacked messages and consumer counts need metrics from the management API or your application.

What is a RabbitMQ health check?

A check that proves the broker is alive and speaking AMQP. The Uptriva agent connects to port 5672, sends the AMQP protocol header and expects a connection.start frame back, which also catches services that occupy the port without being a broker.

Can I monitor RabbitMQ from an external uptime tool?

Only if the broker is reachable from the internet, which it should not be. RabbitMQ almost always sits on a private network, so the check belongs on an agent inside that network rather than on external probes.

Keep reading