Skip to main content

RabbitMQ

RabbitMQ currently offers two methods for integrating monitoring data.

Version Requirement: RabbitMQ (version >= 3.8.0)

Steps:

  1. In the running environment of the RabbitMQ service, enable the Prometheus plugin using the following command:
rabbitmq-plugins enable rabbitmq_prometheus
  1. Add the following configuration to configmap/apo-grafana-alloy-config, replacing the YOUR_RABBITMQ_SERVER_IP variable:
prometheus.scrape "rabbitmq" {
targets = [
{
__address__ = "YOUR_RABBITMQ_SERVER_IP:15692",
job = "integrations/rabbitmq",
},
]
scheme = "http"
scrape_interval = "60s"
forward_to = [prometheus.relabel.example.receiver]
}

Note: When replacing YOUR_RABBITMQ_SERVER_IP, do not include the http or https prefix, e.g., 192.168.1.1:15692.

  1. Use the RabbitMQ Official Metrics dashboard included in APO Grafana to view monitoring data.

Method 2: Using the Community Open-Source Exporter (Integrated into Alloy)

Version Requirement: RabbitMQ (version >= 3.6.8), earlier versions may also be supported. Refer to the Configuration Modification Instructions.

Steps:

  1. Add the following configuration to configmap/apo-grafana-alloy-config. Below is the most basic configuration, replace the YOUR_RABBITMQ_URL variable:
prometheus.exporter.rabbitmq "rabbitmq_demo" {
rabbit_url = YOUR_RABBITMQ_URL
}

prometheus.scrape "rabbitmq_demo" {
targets = prometheus.exporter.rabbitmq.rabbitmq_demo.targets
forward_to = [prometheus.relabel.example.receiver]
}
  1. Use the RabbitMQ Metrics (kbudde/rabbitmq_exporter) dashboard included in APO Grafana to view monitoring data.

Configuration Notes:

The prometheus.exporter.rabbitmq block supports the following optional configurations, all of which are sourced from kbudde/rabbitmq_exporter.

Environment variabledefaultdescription
rabbit_urlhttp://127.0.0.1:15672URL to RabbitMQ management plugin (must start with http(s)://)
rabbit_userguestUsername for RabbitMQ management plugin. User needs monitoring tag!
rabbit_passwordguestPassword for RabbitMQ management plugin
rabbit_connectiondirectDirect or loadbalancer, strips the self label when loadbalancer
rabbit_user_fileLocation of file with username (useful for Docker secrets)
rabbit_password_fileLocation of file with password (useful for Docker secrets)
publish_port9419Listening port for the exporter
publish_addr""Listening host/IP for the exporter
output_formatTTYLog output format. TTY and JSON are supported
log_levelinfoLog level. Possible values: "debug", "info", "warning", "error", "fatal", or "panic"
cafileca.pemPath to root certificate for access management plugin. Only needed if a self-signed certificate is used. Will be ignored if the file does not exist
certfileclient-cert.pemPath to client certificate used to verify the exporter's authenticity. Will be ignored if the file does not exist
keyfileclient-key.pemPath to private key used with certificate to verify the exporter's authenticity. Will be ignored if the file does not exist
skipverifyfalsetrue/0 will ignore certificate errors of the management plugin
skip_vhost^$Regex, matching vhost names are not exported. First performs INCLUDE_VHOST, then SKIP_VHOST. Applies to queues and exchanges
include_vhost.*Regex vhost filter. Only matching vhosts are exported. Applies to queues and exchanges
include_queues.*Regex queue filter. Only matching names are exported
skip_queues^$Regex, matching queue names are not exported (useful for short-lived RPC queues). First performed INCLUDE, after SKIP
include_exchanges.*Regex exchange filter. (Only exchanges in matching vhosts are exported)
skip_exchanges^$Regex, matching exchange names are not exported. First performed INCLUDE, after SKIP
rabbit_capabilitiesbert,no_sortComma-separated list of extended scraping capabilities supported by the target RabbitMQ server
rabbit_exportersexchange,node,queueList of enabled modules. Possible modules: connections, shovel, federation, exchange, node, queue, memory
rabbit_timeout30Timeout in seconds for retrieving data from management plugin.
max_queues0Max number of queues before we drop metrics (disabled if set to 0)
exclude_metricsMetric names to exclude from export. Comma-separated. e.g. "recv_oct, recv_cnt". See exporter_*.go for names

Certainly! Since the original text provided is empty, there's nothing to translate. If you have any specific content you'd like translated into English, please provide it, and I'll be happy to assist!