Skip to main content
APA
Sponsored by CAST AI — Kubernetes cost optimization Better Stack — Uptime monitoring and log management
⚠️

Alert thresholds depend on the nature of your applications. Some queries may have arbitrary tolerance thresholds. Building an efficient monitoring platform takes time. 😉

RabbitMQ Prometheus Alert Rules

21 Prometheus alerting rules for RabbitMQ. Exported via rabbitmq/rabbitmq-prometheus, kbudde/rabbitmq-exporter. These rules cover critical and warning conditions — copy and paste the YAML into your Prometheus configuration.

wget https://raw.githubusercontent.com/samber/awesome-prometheus-alerts/refs/heads/master/dist/rules/rabbitmq/rabbitmq-exporter.yml
critical

3.1.1.1. RabbitMQ node down

Less than 3 nodes running in RabbitMQ cluster

  # 1m delay allows a restart without triggering an alert.
- alert: RabbitMQNodeDown
  expr: sum(rabbitmq_build_info) < 3
  for: 1m
  labels:
    severity: critical
  annotations:
    summary: RabbitMQ node down (instance {{ $labels.instance }})
    description: "Less than 3 nodes running in RabbitMQ cluster\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

3.1.1.2. RabbitMQ node not distributed

Distribution link to peer {{ $labels.peer }} is not 'up' (state {{ $value }})

  # 1m delay allows a restart without triggering an alert.
- alert: RabbitMQNodeNotDistributed
  expr: erlang_vm_dist_node_state < 3
  for: 1m
  labels:
    severity: critical
  annotations:
    summary: RabbitMQ node not distributed (instance {{ $labels.instance }})
    description: "Distribution link to peer {{ $labels.peer }} is not 'up' (state {{ $value }})\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.1.3. RabbitMQ instances different versions

Running different version of RabbitMQ in the same cluster, can lead to failure.

- alert: RabbitMQInstancesDifferentVersions
  expr: count(count(rabbitmq_build_info) by (rabbitmq_version)) > 1
  for: 1h
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ instances different versions (instance {{ $labels.instance }})
    description: "Running different version of RabbitMQ in the same cluster, can lead to failure.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.1.4. RabbitMQ memory high

A node use more than 90% of allocated RAM

- alert: RabbitMQMemoryHigh
  expr: rabbitmq_process_resident_memory_bytes / rabbitmq_resident_memory_limit_bytes * 100 > 90 and rabbitmq_resident_memory_limit_bytes > 0
  for: 2m
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ memory high (instance {{ $labels.instance }})
    description: "A node use more than 90% of allocated RAM\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.1.5. RabbitMQ file descriptors usage

A node use more than 90% of file descriptors

- alert: RabbitMQFileDescriptorsUsage
  expr: rabbitmq_process_open_fds / rabbitmq_process_max_fds * 100 > 90 and rabbitmq_process_max_fds > 0
  for: 2m
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ file descriptors usage (instance {{ $labels.instance }})
    description: "A node use more than 90% of file descriptors\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.1.6. RabbitMQ too many ready messages

RabbitMQ too many ready messages on queue {{ $labels.queue }} ({{ $value }})

- alert: RabbitMQTooManyReadyMessages
  expr: sum(rabbitmq_queue_messages_ready) BY (queue) > 1000
  for: 1m
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ too many ready messages (instance {{ $labels.instance }})
    description: "RabbitMQ too many ready messages on queue {{ $labels.queue }} ({{ $value }})\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.1.7. RabbitMQ too many unack messages

Too many unacknowledged messages on queue {{ $labels.queue }} ({{ $value }})

- alert: RabbitMQTooManyUnackMessages
  expr: sum(rabbitmq_queue_messages_unacked) BY (queue) > 1000
  for: 1m
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ too many unack messages (instance {{ $labels.instance }})
    description: "Too many unacknowledged messages on queue {{ $labels.queue }} ({{ $value }})\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.1.8. RabbitMQ too many connections

The total connections of a node is too high

- alert: RabbitMQTooManyConnections
  expr: rabbitmq_connections > 1000
  for: 2m
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ too many connections (instance {{ $labels.instance }})
    description: "The total connections of a node is too high\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.1.9. RabbitMQ no queue consumer

A queue has less than 1 consumer

- alert: RabbitMQNoQueueConsumer
  expr: rabbitmq_queue_consumers < 1
  for: 1m
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ no queue consumer (instance {{ $labels.instance }})
    description: "A queue has less than 1 consumer\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.1.10. RabbitMQ unroutable messages

A queue has unroutable messages ({{ $value }} in the last 5m)

  # Threshold of 3 avoids noise from occasional misroutes. Adjust based on your expected traffic patterns.
- alert: RabbitMQUnroutableMessages
  expr: increase(rabbitmq_channel_messages_unroutable_returned_total[5m]) > 3 or increase(rabbitmq_channel_messages_unroutable_dropped_total[5m]) > 3
  for: 2m
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ unroutable messages (instance {{ $labels.instance }})
    description: "A queue has unroutable messages ({{ $value }} in the last 5m)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"

3.1.2. kbudde/rabbitmq-exporter (11 rules)

wget https://raw.githubusercontent.com/samber/awesome-prometheus-alerts/refs/heads/master/dist/rules/rabbitmq/kbudde-rabbitmq-exporter.yml
critical

3.1.2.1. RabbitMQ down

RabbitMQ node down

  # 1m delay allows a restart without triggering an alert.
- alert: RabbitMQDown
  expr: rabbitmq_up == 0
  for: 1m
  labels:
    severity: critical
  annotations:
    summary: RabbitMQ down (instance {{ $labels.instance }})
    description: "RabbitMQ node down\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

3.1.2.2. RabbitMQ cluster down

Less than 3 nodes running in RabbitMQ cluster

  # 1m delay allows a restart without triggering an alert.
- alert: RabbitMQClusterDown
  expr: sum(rabbitmq_running) < 3
  for: 1m
  labels:
    severity: critical
  annotations:
    summary: RabbitMQ cluster down (instance {{ $labels.instance }})
    description: "Less than 3 nodes running in RabbitMQ cluster\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

3.1.2.3. RabbitMQ cluster partition

RabbitMQ cluster has a network partition ({{ $value }} partitions detected). Messages may be lost or duplicated.

- alert: RabbitMQClusterPartition
  expr: rabbitmq_partitions > 0
  for: 0m
  labels:
    severity: critical
  annotations:
    summary: RabbitMQ cluster partition (instance {{ $labels.instance }})
    description: "RabbitMQ cluster has a network partition ({{ $value }} partitions detected). Messages may be lost or duplicated.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.2.4. RabbitMQ out of memory

Memory available for RabbitMQ is low (< 10%)

- alert: RabbitMQOutOfMemory
  expr: rabbitmq_node_mem_used / rabbitmq_node_mem_limit * 100 > 90 and rabbitmq_node_mem_limit > 0
  for: 2m
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ out of memory (instance {{ $labels.instance }})
    description: "Memory available for RabbitMQ is low (< 10%)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.2.5. RabbitMQ instance too many connections

RabbitMQ instance has too many connections (> 1000)

- alert: RabbitMQInstanceTooManyConnections
  expr: rabbitmq_connections > 1000
  for: 2m
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ instance too many connections (instance {{ $labels.instance }})
    description: "RabbitMQ instance has too many connections (> 1000)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.2.6. RabbitMQ dead letter queue filling up

Dead letter queue is filling up (> 10 msgs)

  # Indicate the queue name in dedicated label.
- alert: RabbitMQDeadLetterQueueFillingUp
  expr: rabbitmq_queue_messages{queue="my-dead-letter-queue"} > 10
  for: 1m
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ dead letter queue filling up (instance {{ $labels.instance }})
    description: "Dead letter queue is filling up (> 10 msgs)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.2.7. RabbitMQ too many messages in queue

Queue is filling up (> 1000 msgs)

  # Indicate the queue name in dedicated label.
- alert: RabbitMQTooManyMessagesInQueue
  expr: rabbitmq_queue_messages_ready{queue="my-queue"} > 1000
  for: 2m
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ too many messages in queue (instance {{ $labels.instance }})
    description: "Queue is filling up (> 1000 msgs)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.2.8. RabbitMQ slow queue consuming

Queue messages are consumed slowly (> 60s)

  # Indicate the queue name in dedicated label.
- alert: RabbitMQSlowQueueConsuming
  expr: time() - rabbitmq_queue_head_message_timestamp{queue="my-queue"} > 60
  for: 2m
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ slow queue consuming (instance {{ $labels.instance }})
    description: "Queue messages are consumed slowly (> 60s)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

3.1.2.9. RabbitMQ no consumer

Queue has no consumer

  # Allows a short service restart.
- alert: RabbitMQNoConsumer
  expr: rabbitmq_queue_consumers == 0
  for: 5m
  labels:
    severity: critical
  annotations:
    summary: RabbitMQ no consumer (instance {{ $labels.instance }})
    description: "Queue has no consumer\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

3.1.2.10. RabbitMQ too many consumers

Queue should have only 1 consumer

  # Indicate the queue name in dedicated label.
- alert: RabbitMQTooManyConsumers
  expr: rabbitmq_queue_consumers{queue="my-queue"} > 1
  for: 0m
  labels:
    severity: critical
  annotations:
    summary: RabbitMQ too many consumers (instance {{ $labels.instance }})
    description: "Queue should have only 1 consumer\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

3.1.2.11. RabbitMQ inactive exchange

Exchange receive less than 5 msgs per second

  # Indicate the exchange name in dedicated label.
- alert: RabbitMQInactiveExchange
  expr: rate(rabbitmq_exchange_messages_published_in_total{exchange="my-exchange"}[1m]) < 5
  for: 2m
  labels:
    severity: warning
  annotations:
    summary: RabbitMQ inactive exchange (instance {{ $labels.instance }})
    description: "Exchange receive less than 5 msgs per second\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"