Monitoring RabbitMQ

Configure the Server Density agent to monitor your RabbitMQ instance to:

• Collect important metrics, such as performance, connections and utilisation
• Identify overall server slowdowns caused by the message broker

We do not support temporary RabbitMQ queues and these will be removed from your payloads upon payload processing. This includes queues with the prefixes 'amqgen-','amq.gen-','celeryev.' or the suffix 'reply.celery.pidbox'

Monitored metrics

  • Connections
  • Acknowledgement Rate
  • Deliver Rate
  • Deliver Count
  • Publish Count
  • Acknowledgement Count
  • Deliver get Count
  • Deliver get Count
  • Publish Rate
  • Rate
  • Status
  • Slave nodes
  • Auto delete
  • PID
  • Idle since
  • Message stats
  • Messages unacknowledged
  • Owner pid
  • Consumer
  • Durable
  • Exclusive consumer tag
  • Active consumers
  • Arguments
  • Memory
  • Policy
  • Ready messages
  • Node
  • Transactions
  • Message details
  • Synchronised slave nodes
  • Acks uncommitted
  • Unacknowledged messages
  • Name
  • Vhost
  • Backing queue status
  • Messages
  • Messages uncommitted
  • Messages ready
  • Consumer Utilisation
  • Redeliver Rate
  • Redeliver Count

Installing the RabbitMQ plugin package

Install the RabbitMQ plugin on Debian/Ubuntu:

sudo apt-get install sd-agent-rabbitmq

Install the RabbitMQ plugin on RHEL/CentOS:

sudo yum install sd-agent-rabbitmq

Read more about agent plugins.

Configuring the agent to monitor RabbitMQ

1. To monitor RabbitMQ, you’ll need to install the Management Plugin. If you specify a user and password to connect to RabbitMQ, define it in step 2.

2. Configure /etc/sd-agent/conf.d/rabbitmq.yaml

init_config:
instances:
# A 'rabbitmq_api_url' must be provided, pointing to the api url of the
# RabbitMQ Managment Plugin (http://www.rabbitmq.com/management.html)
# optional: 'rabbitmq_user' (default: guest) and 'rabbitmq_pass' (default: guest)
- rabbitmq_api_url: http://localhost:15672/api/
  rabbitmq_user: guest
  rabbitmq_pass: guest
  # Use the `nodes` or `nodes_regexes` parameters to specify the nodes you'd like to
  # collect metrics on (up to 100 nodes).
  # If you have less than 100 nodes, you don't have to set this parameter,
  # the metrics will be collected on all the nodes by default.
  #
  # nodes:
  # - rabbit@localhost
  # - rabbit2@domain
  # nodes_regexes:
  # - bla.*  

# Use the `queues` or `queues_regexes` parameters to specify the queues you'd like to
  # collect metrics on (up to 200 queues).
  # If you have less than 200 queues, you don't have to set this parameter,
  # the metrics will be collected on all the queues by default.
  # If you have set up vhosts, set the queue names as `vhost_name/queue_name`.
  # If you have `tag_families` enabled, the first captured group in the regex
  # will be used as the queue_family tag
  #
  # queues:
  # - queue1
  # - queue2
  # queues_regexes:
  # - thisqueue-.*
  # - another_\d+queue

3. Restart the agent

sudo /etc/init.d/sd-agent restart

Verifying the configuration
Execute info to verify the configuration with the following:

sudo /etc/init.d/sd-agent info 

If the agent has been configured correctly you’ll see an output such as:

rabbitmq
-----
  - instance #0 [OK]
  - Collected 25 metrics & 0 events

You can also view the metrics returned with the following command:

sudo -u sd-agent /usr/share/python/sd-agent/agent.py check rabbitmq

Configuring alerts

In order to create alerts on a queue you need to modify the queue name in the following ways:

1) Remove the host part from the queue name - e.g. Production/App.Errors becomes App.Errors 
2) Replace periods with underscores - e.g. App.Errors becomes App_Errors

A queue called Production/App.Errors would need to be entered as App_Errors.

Configuring graphs

Click the name of your server from the Devices list in your Server Density account then go to the Metrics tab. Click the + Graph button on the right then choose the RabbitMQ metrics to display the graphs. The metrics will also be available to select when building dashboard graphs.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Monday  —  Friday.

10am  —  6pm UK.

Dedicated Support.