RabbitMQ
New announcements from Dash: Incident Management, Continuous Profiler, and more! New announcements from Dash!

RabbitMQ

Agent Check Agent Check

Supported OS: Linux Mac OS Windows

RabbitMQ Dashboard

Overview

This check monitors RabbitMQ through the Datadog Agent. It allows you to:

  • Track queue-based stats: queue size, consumer count, unacknowledged messages, redelivered messages, etc.
  • Track node-based stats: waiting processes, used sockets, used file descriptors, etc.
  • Monitor vhosts for aliveness and number of connections

And more.

Setup

Installation

The RabbitMQ check is included in the Datadog Agent package. No additional installation is needed on your server.

Configuration

Prepare RabbitMQ

Enable the RabbitMQ management plugin. See RabbitMQ’s documentation to enable it. The Agent user then needs at least the monitoring tag and these required permissions:

PermissionCommand
conf^aliveness-test$
write^amq\.default$
read.*

Create an Agent user for your default vhost with the following commands:

rabbitmqctl add_user datadog <SECRET>
rabbitmqctl set_permissions  -p / datadog "^aliveness-test$" "^amq\.default$" ".*"
rabbitmqctl set_user_tags datadog monitoring

Here, / refers to the default host. Set this to your specified virtual host name. See the RabbitMQ documentation for more information.

Host

To configure this check for an Agent running on a host:

Metric collection
  1. Edit the rabbitmq.d/conf.yaml file, in the conf.d/ folder at the root of your Agent’s configuration directory to start collecting your RabbitMQ metrics. See the sample rabbitmq.d/conf.yaml for all available configuration options.

    init_config:
    
    instances:
     ## @param rabbit_api_url - string - required
     ## For every instance a 'rabbitmq_api_url' must be provided, pointing to the api
     ## url of the RabbitMQ Managment Plugin (http://www.rabbitmq.com/management.html).
     #
     - rabbitmq_api_url: http://localhost:15672/api/

    Note: The Agent checks all queues, vhosts, and nodes by default, but you can provide lists or regexes to limit this. See the rabbitmq.d/conf.yaml for examples.

  2. Restart the Agent.

Log collection

Available for Agent versions >6.0

  1. To modify the default log file location either set the RABBITMQ_LOGS environment variable or add the following to your RabbitMQ configuration file (/etc/rabbitmq/rabbitmq.conf):

     log.dir = /var/log/rabbit
     log.file = rabbit.log
  2. Collecting logs is disabled by default in the Datadog Agent, enable it in your datadog.yaml file:

    logs_enabled: true
  3. Add this configuration block to your rabbitmq.d/conf.yaml file to start collecting your RabbitMQ logs:

    logs:
     - type: file
       path: /var/log/rabbit/*.log
       source: rabbitmq
       service: myservice
       log_processing_rules:
         - type: multi_line
           name: logs_starts_with_equal_sign
           pattern: "="
  4. Restart the Agent.

Containerized

For containerized environments, see the Autodiscovery Integration Templates for guidance on applying the parameters below.

Metric collection
ParameterValue
<INTEGRATION_NAME>rabbitmq
<INIT_CONFIG>blank or {}
<INSTANCE_CONFIG>{"rabbitmq_api_url":"%%host%%:15672/api/","username": <USERNAME>, "password": <PASSWORD>}
Log collection

Available for Agent versions >6.0

Collecting logs is disabled by default in the Datadog Agent. To enable it, see Kubernetes log collection documentation.

ParameterValue
<LOG_CONFIG>{"source": "rabbitmq", "service": "rabbitmq", "log_processing_rules": {"type":"multi_line","name":"logs_starts_with_equal_sign", "pattern": "="}}

Validation

Run the Agent’s status subcommand and look for rabbitmq under the Checks section.

Data Collected

Metrics

rabbitmq.node.fd_used
(gauge)
Used file descriptors
rabbitmq.node.disk_free
(gauge)
Current free disk space
Shown as byte
rabbitmq.node.mem_used
(gauge)
Memory used in bytes
Shown as byte
rabbitmq.node.mem_limit
(gauge)
Memory usage high watermark in bytes
Shown as byte
rabbitmq.node.run_queue
(gauge)
Average number of Erlang processes waiting to run
Shown as process
rabbitmq.node.sockets_used
(gauge)
Number of file descriptors used as sockets
rabbitmq.node.partitions
(gauge)
Number of network partitions this node is seeing
rabbitmq.node.running
(gauge)
Is the node running or not
rabbitmq.node.mem_alarm
(gauge)
Does the host has memory alarm
rabbitmq.node.disk_alarm
(gauge)
Does the node have disk alarm
rabbitmq.exchange.messages.ack.count
(gauge)
Number of messages in exchanges delivered to clients and acknowledged
Shown as message
rabbitmq.exchange.messages.ack.rate
(gauge)
Rate of messages in exchanges delivered to clients and acknowledged per second
Shown as message
rabbitmq.exchange.messages.confirm.count
(gauge)
Count of messages in exchanges confirmed
Shown as message
rabbitmq.exchange.messages.confirm.rate
(gauge)
Rate of messages in exchanges confirmed per second
Shown as message
rabbitmq.exchange.messages.deliver_get.count
(gauge)
Sum of messages in exchanges delivered in acknowledgement mode to consumers, in no-acknowledgement mode to consumers, in acknowledgement mode in response to basic.get, and in no-acknowledgement mode in response to basic.get
Shown as message
rabbitmq.exchange.messages.deliver_get.rate
(gauge)
Rate per second of the sum of exchange messages delivered in acknowledgement mode to consumers, in no-acknowledgement mode to consumers, in acknowledgement mode in response to basic.get, and in no-acknowledgement mode in response to basic.get
Shown as message
rabbitmq.exchange.messages.redeliver.count
(gauge)
Count of subset of messages in exchanges in deliver_get which had the redelivered flag set
Shown as message
rabbitmq.exchange.messages.redeliver.rate
(gauge)
Rate of subset of messages in exchanges in deliver_get which had the redelivered flag set per second
Shown as message
rabbitmq.exchange.messages.return_unroutable.count
(gauge)
Count of messages in exchanges returned to publisher as unroutable
Shown as message
rabbitmq.exchange.messages.return_unroutable.rate
(gauge)
Rate of messages in exchanges returned to publisher as unroutable per second
Shown as message
rabbitmq.exchange.messages.publish.count
(gauge)
Count of messages in exchanges published
Shown as message
rabbitmq.exchange.messages.publish.rate
(gauge)
Rate of messages in exchanges published per second
Shown as message
rabbitmq.exchange.messages.publish_in.count
(gauge)
Count of messages published from channels into this exchange
Shown as message
rabbitmq.exchange.messages.publish_in.rate
(gauge)
Rate of messages published from channels into this exchange per sec
Shown as message
rabbitmq.exchange.messages.publish_out.count
(gauge)
Count of messages published from this exchange into queues
Shown as message
rabbitmq.exchange.messages.publish_out.rate
(gauge)
Rate of messages published from this exchange into queues per second
Shown as message
rabbitmq.queue.active_consumers
(gauge)
Number of active consumers, consumers that can immediately receive any messages sent to the queue
rabbitmq.queue.bindings.count
(gauge)
Number of bindings for a specific queue
rabbitmq.queue.consumers
(gauge)
Number of consumers
rabbitmq.queue.consumer_utilisation
(gauge)
The ratio of time that a queue's consumers can take new messages
Shown as fraction
rabbitmq.queue.head_message_timestamp
(gauge)
Timestamp of the head message of the queue
Shown as millisecond
rabbitmq.queue.memory
(gauge)
Bytes of memory consumed by the Erlang process associated with the queue, including stack, heap and internal structures
Shown as byte
rabbitmq.queue.messages
(gauge)
Count of the total messages in the queue
Shown as message
rabbitmq.queue.messages.rate
(gauge)
Count per second of the total messages in the queue
Shown as message
rabbitmq.queue.messages_ready
(gauge)
Number of messages ready to be delivered to clients
Shown as message
rabbitmq.queue.messages_ready.rate
(gauge)
Number per second of messages ready to be delivered to clients
Shown as message
rabbitmq.queue.messages_unacknowledged
(gauge)
Number of messages delivered to clients but not yet acknowledged
Shown as message
rabbitmq.queue.messages_unacknowledged.rate
(gauge)
Number per second of messages delivered to clients but not yet acknowledged
Shown as message
rabbitmq.queue.messages.ack.count
(gauge)
Number of messages in queues delivered to clients and acknowledged
Shown as message
rabbitmq.queue.messages.ack.rate
(gauge)
Number per second of messages delivered to clients and acknowledged
Shown as message
rabbitmq.queue.messages.deliver.count
(gauge)
Count of messages delivered in acknowledgement mode to consumers
Shown as message
rabbitmq.queue.messages.deliver.rate
(gauge)
Rate of messages delivered in acknowledgement mode to consumers
Shown as message
rabbitmq.queue.messages.deliver_get.count
(gauge)
Sum of messages in queues delivered in acknowledgement mode to consumers, in no-acknowledgement mode to consumers, in acknowledgement mode in response to basic.get, and in no-acknowledgement mode in response to basic.get.
Shown as message
rabbitmq.queue.messages.deliver_get.rate
(gauge)
Rate per second of the sum of messages in queues delivered in acknowledgement mode to consumers, in no-acknowledgement mode to consumers, in acknowledgement mode in response to basic.get, and in no-acknowledgement mode in response to basic.get.
Shown as message
rabbitmq.queue.messages.publish.count
(gauge)
Count of messages in queues published
Shown as message
rabbitmq.queue.messages.publish.rate
(gauge)
Rate per second of messages published
Shown as message
rabbitmq.queue.messages.redeliver.count
(gauge)
Count of subset of messages in queues in deliver_get which had the redelivered flag set
Shown as message
rabbitmq.queue.messages.redeliver.rate
(gauge)
Rate per second of subset of messages in deliver_get which had the redelivered flag set
Shown as message
rabbitmq.connections
(gauge)
Number of current connections to a given rabbitmq vhost, tagged 'rabbitmq_vhost:'
Shown as connection
rabbitmq.connections.state
(gauge)
Number of connections in the specified connection state
Shown as connection
rabbitmq.overview.object_totals.connections
(gauge)
Total number of connections
Shown as connection
rabbitmq.overview.object_totals.channels
(gauge)
Total number of channels
Shown as item
rabbitmq.overview.object_totals.queues
(gauge)
Total number of queues
Shown as item
rabbitmq.overview.object_totals.consumers
(gauge)
Total number of consumers
Shown as item
rabbitmq.overview.queue_totals.messages.count
(gauge)
Total number of messages (ready plus unacknowledged)
Shown as message
rabbitmq.overview.queue_totals.messages.rate
(gauge)
Rate of number of messages (ready plus unacknowledged)
Shown as message
rabbitmq.overview.queue_totals.messages_ready.count
(gauge)
Number of messages ready for delivery
Shown as message
rabbitmq.overview.queue_totals.messages_ready.rate
(gauge)
Rate of number of messages ready for delivery
Shown as message
rabbitmq.overview.queue_totals.messages_unacknowledged.count
(gauge)
Number of unacknowledged messages
Shown as message
rabbitmq.overview.queue_totals.messages_unacknowledged.rate
(gauge)
Rate of number of unacknowledged messages
Shown as message
rabbitmq.overview.messages.ack.count
(gauge)
Number of messages delivered to clients and acknowledged
Shown as message
rabbitmq.overview.messages.ack.rate
(gauge)
Rate of messages delivered to clients and acknowledged per second
Shown as message
rabbitmq.overview.messages.confirm.count
(gauge)
Count of messages confirmed
Shown as message
rabbitmq.overview.messages.confirm.rate
(gauge)
Rate of messages confirmed per second
Shown as message
rabbitmq.overview.messages.deliver_get.count
(gauge)
Sum of messages delivered in acknowledgement mode to consumers, in no-acknowledgement mode to consumers, in acknowledgement mode in response to basic.get, and in no-acknowledgement mode in response to basic.get
Shown as message
rabbitmq.overview.messages.deliver_get.rate
(gauge)
Rate per second of the sum of messages delivered in acknowledgement mode to consumers, in no-acknowledgement mode to consumers, in acknowledgement mode in response to basic.get, and in no-acknowledgement mode in response to basic.get
Shown as message
rabbitmq.overview.messages.redeliver.count
(gauge)
Count of subset of messages in deliver_get which had the redelivered flag set
Shown as message
rabbitmq.overview.messages.redeliver.rate
(gauge)
Rate of subset of messages in deliver_get which had the redelivered flag set per second
Shown as message
rabbitmq.overview.messages.return_unroutable.count
(gauge)
Count of messages returned to publisher as unroutable
Shown as message
rabbitmq.overview.messages.return_unroutable.rate
(gauge)
Rate of messages returned to publisher as unroutable per second
Shown as message
rabbitmq.overview.messages.publish.count
(gauge)
Count of messages published
Shown as message
rabbitmq.overview.messages.publish.rate
(gauge)
Rate of messages published per second
Shown as message
rabbitmq.overview.messages.publish_in.count
(gauge)
Count of messages published from channels into this overview
Shown as message
rabbitmq.overview.messages.publish_in.rate
(gauge)
Rate of messages published from channels into this overview per sec
Shown as message
rabbitmq.overview.messages.publish_out.count
(gauge)
Count of messages published from this overview into queues
Shown as message
rabbitmq.overview.messages.publish_out.rate
(gauge)
Rate of messages published from this overview into queues per second
Shown as message

The Agent tags rabbitmq.queue.* metrics by queue name and rabbitmq.node.* metrics by node name.

Events

For performance reasons, the RabbitMQ check limits the number of exchanges, queues, and nodes it collects metrics for. If the check nears this limit, it emits a warning-level event to your event stream.

If you require an increase in the number of exchanges, queues, or nodes, contact Datadog support.

Service Checks

rabbitmq.aliveness:
The Agent submits this service check for all vhosts (if vhosts is not configured) OR a subset of vhosts (those configured in vhosts). Each service check is tagged with vhost:<vhost_name>. Returns CRITICAL if the aliveness check failed, otherwise returns OK.

rabbitmq.status:
Returns CRITICAL if the Agent cannot connect to RabbitMQ to collect metrics, otherwise returns OK.

Troubleshooting

Need help? Contact Datadog support.

Further Reading

Additional helpful documentation, links, and articles:

Datadog Blog

FAQ