Skip to main content

RabbitMQ

Monitor RabbitMQ queue depths, message rates, connection counts, and node resource usage.

RabbitMQ Dashboard

Key Metrics

MetricDescription
rabbitmq_queue_messagesMessages ready in queue
rabbitmq_queue_messages_unackedUnacknowledged messages
rabbitmq_connections_totalActive connections
rabbitmq_channel_messages_published_totalPublished messages
rabbitmq_node_mem_usedMemory used by the node
rabbitmq_node_disk_freeFree disk space on node

Prerequisites

  • RabbitMQ 3.8+ with the Prometheus plugin enabled
  • Network access to the management port 15692

Configuration

Enable the Prometheus plugin

rabbitmq-plugins enable rabbitmq_prometheus

Option A — Prometheus scrape

RabbitMQ exposes metrics natively on port 15692 when the plugin is enabled.

scrape_configs:
- job_name: rabbitmq
static_configs:
- targets: ['localhost:15692']

remote_write:
- url: https://<region>.xscalerlabs.com/api/v1/push
headers:
X-Scope-OrgID: <tenant-id>
basic_auth:
password: <api-token>

Option B — Grafana Alloy

prometheus.scrape "rabbitmq" {
targets = [{"__address__" = "localhost:15692"}]
forward_to = [prometheus.remote_write.xscaler.receiver]
}

prometheus.remote_write "xscaler" {
endpoint {
url = "https://<region>.xscalerlabs.com/api/v1/push"
headers = { "X-Scope-OrgID" = "<tenant-id>" }
basic_auth { password = "<api-token>" }
}
}

Option C — OpenTelemetry Collector

receivers:
rabbitmq:
endpoint: http://localhost:15672
username: guest
password: ${RABBITMQ_PASSWORD}
collection_interval: 60s

exporters:
prometheusremotewrite:
endpoint: https://<region>.xscalerlabs.com/api/v1/push
headers:
Authorization: Bearer <api-token>
X-Scope-OrgID: <tenant-id>

service:
pipelines:
metrics:
receivers: [rabbitmq]
exporters: [prometheusremotewrite]

Logs

Collect RabbitMQ broker log. Add the following to your Alloy config:

local.file_match "rabbitmq_logs" {
path_targets = [{
__address__ = "localhost",
__path__ = "/var/log/rabbitmq/*.log",
instance = constants.hostname,
job = "integrations/rabbitmq",
}]
}

loki.source.file "rabbitmq_logs" {
targets = local.file_match.rabbitmq_logs.targets
forward_to = [loki.write.xscaler.receiver]
}

loki.write "xscaler" {
endpoint {
url = "https://euw1-01.l.xscalerlabs.com/api/v1/logs/push"

http_client_config {
authorization {
type = "Bearer"
credentials = env("XSCALER_TOKEN")
}
}

headers = { "X-Scope-OrgID" = env("XSCALER_TENANT_ID") }
}
}