RabbitMQ

Overview

This plugin collects metrics directly from the rabbitmq management API. The plugin requests the machine-readable content from this endpoint and parses metrics out from the retrieved data.

Note

This plugin is currently only available for x86_64 Linux.

Setup

The rabbitmq plugin is included with the AppOptics host agent by default, please follow the directions below to enable it for a host agent instance.

Prerequisites

This plugin requires both an enabled management plugin and the corresponding management API connection credentials to monitor. The links below outline how this can be configured for a given rabbitmq instance:

Note

The recommended rabbitmq version is v3.7.0+, but this plugin does support both legacy and current installations. Please note there are breaking changes to the management API from v3.7.0 which precludes collection of certain metrics. These are outlined in the Metrics and Tags section further below.

Configuration

The host agent provides an example configuration file to help you get started quickly. It defines the plugin and task file to be loaded by the agent, but requires you to provide the correct settings for your management API endpoint. To enable the plugin:

  1. Make a copy of the rabbitmq example configuration file /opt/appoptics/etc/plugins.d/rabbitmq.yaml.example, renaming it to /opt/appoptics/etc/plugins.d/rabbitmq.yaml:
$ sudo cp /opt/appoptics/etc/plugins.d/rabbitmq.yaml.example /opt/appoptics/etc/plugins.d/rabbitmq.yaml
  1. Update the /opt/appoptics/etc/plugins.d/rabbitmq.yaml configuration file with settings specific to your rabbitmq instance, for example:
collector:
  rabbitmq:
    all:
      url: "http://localhost:15672"
      user: "guest"
      password: "guest"

load:
  plugin: snap-plugin-collector-aorabbitmq
  task: task-aorabbitmq.yaml

Each of the url, user, and password flags are optional and default to the RabbitMQ http://localhost:15672/, guest, guest values respectively as outlined in documentation. Most administrators will have configured a separate user for accessing the management API endpoint but this is not required provided the guest user is still enabled. If you are using a separate user, please ensure the user has the requisite exchanges, vhosts, nodes and queues permissions set in order to collect metrics from those endpoints.

Additionally, you’ll want to set the management process to enable detailed for rates_mode which will make verbose information available to the plugin.

$ sudo rabbitmqctl eval 'application:set_env(rabbitmq_management, rates_mode, detailed).'
  1. Restart the host agent:
$ sudo service appoptics-snapteld restart
  1. Enable the RabbitMQ plugin in the AppOptics UI

On the Integrations Page you will see the RabbitMQ plugin available if the previous steps were successful. If you do not see the plugin, see Troubleshooting.

Select the RabbitMQ plugin to open the configuration menu in the UI, and enable the plugin.

You should soon see the rabbitmq metrics reported to your dashboard.

Metrics and Tags

The tables below outline the default set of metrics collected by the rabbitmq plugin along with the optional metrics available.

Default Metrics

Namespace Description
rabbitmq.exchanges.message_stats.publish_in count of messages published “in” to an exchange
rabbitmq.exchanges.message_stats.publish_out ount of messages published “out” of an exchange
rabbitmq.exchanges.message_stats.publish_in_details.rate change per second of the publish_in counter
rabbitmq.exchanges.message_stats.publish_out_details.rate change per second of the publish_out counter
rabbitmq.nodes.fd_used used file descriptors
rabbitmq.nodes.mem_used bytes of memory consumed by node processes
rabbitmq.nodes.mem_used_details.rate change per second of the mem_used counter
rabbitmq.nodes.memory.connection_channels bytes consumed by connection channels 1
rabbitmq.nodes.memory.mgmt_db bytes consumed by the management database 1
rabbitmq.nodes.memory.total total amount as reported by the effective memory calculation strategy (bytes)
rabbitmq.nodes.proc_used number of processes used by nodes
rabbitmq.nodes.sockets_used number of socket file descriptors used
rabbitmq.queues.consumers number of queue consumers (total count)
rabbitmq.queues.memory bytes of memory consumed by the Erlang process associated with the queue, including stack, heap and internal structures
rabbitmq.queues.message_stats.publish count of messages published
rabbitmq.queues.message_stats.publish_details.rate change per second of the publish counter
rabbitmq.queues.messages sum of ready and unacknowledged messages (queue depth)
rabbitmq.queues.messages_details.rate change per second of the messages counter
rabbitmq.queues.messages_ready number of messages ready to be delivered to clients
rabbitmq.queues.messages_ready_details.rate change per second of the messages_ready counter
rabbitmq.queues.messages_unacknowledged number of messages delivered to clients but not yet acknowledged
rabbitmq.queues.messages_unacknowledged_details.rate change per second of the messages_unacknowledged counter
rabbitmq.vhosts.message_stats.publish count of messages published
rabbitmq.vhosts.message_stats.publish_details.rate change per second of the publish counter
rabbitmq.vhosts.messages sum of ready and unacknowledged messages (queue depth)
rabbitmq.vhosts.messages_details.rate change per second of the messages counter
rabbitmq.vhosts.messages_ready number of messages ready to be delivered to clients
rabbitmq.vhosts.messages_ready_details.rate change per second of the messages_ready counter
rabbitmq.vhosts.messages_unacknowledged number of messages delivered to clients but not yet acknowledged
rabbitmq.vhosts.messages_unacknowledged_details.rate change per second of the messages_unacknowledged counter

Optional Metrics

Namespace Description
rabbitmq.exchanges.message_stats.confirm count of messages confirmed
rabbitmq.exchanges.message_stats.confirm_details.rate change per second of the confirm counter
rabbitmq.nodes.disk_free disk free space in bytes
rabbitmq.nodes.disk_free_details.rate change per second of the disk_free counter
rabbitmq.nodes.fd_used_details.rate change per second of the fd_used counter
rabbitmq.nodes.io_read_avg_time avg wall time (milliseconds) for each disk read operation in the last statistics interval
rabbitmq.nodes.io_read_avg_time_details.rate change per second of the io_read_avg_time counter
rabbitmq.nodes.io_read_bytes total number of bytes read from disk by the persister
rabbitmq.nodes.io_read_bytes_details.rate change per second of the io_read_bytes counter
rabbitmq.nodes.io_read_count total number of read operations by the persister
rabbitmq.nodes.io_read_count_details.rate change per second of the io_read_count counter
rabbitmq.nodes.io_seek_avg_time average wall time (milliseconds) for each seek operation in the last statistics interval
rabbitmq.nodes.io_seek_avg_time_details.rate change per second of the io_seek_avg_time counter
rabbitmq.nodes.io_seek_count total number of seek operations by the persister
rabbitmq.nodes.io_seek_count_details.rate change per second of the io_seek_count counter
rabbitmq.nodes.io_sync_avg_time average wall time (milliseconds) for each fsync() operation in the last statistics interval
rabbitmq.nodes.io_sync_avg_time_details.rate change per second of the io_sync_avg_time
rabbitmq.nodes.io_sync_count total number of fsync() operations by the persister
rabbitmq.nodes.io_sync_count_details.rate change per second of the io_sync_count counter
rabbitmq.nodes.io_write_avg_time average wall time (milliseconds) for each disk write operation in the last statistics interval
rabbitmq.nodes.io_write_avg_time_details.rate change per second of the io_write_avg_time counter
rabbitmq.nodes.io_write_bytes total number of bytes written to disk by the persister
rabbitmq.nodes.io_write_bytes_details.rate change per second of the io_write_bytes counter
rabbitmq.nodes.io_write_count total number of write operations by the persister
rabbitmq.nodes.io_write_count_details.rate change per second of the io_write_count counter
rabbitmq.nodes.memory.atom bytes consumed by atom processes 1
rabbitmq.nodes.memory.binary bytes consumed by the runtime binary heap 1
rabbitmq.nodes.memory.code bytes consumed by bytecode and module metadata 1
rabbitmq.nodes.memory.connection_other bytes consumed by client connections 1
rabbitmq.nodes.memory.connection_readers bytes consumed by processes responsible for connection parser and most of connection state 1
rabbitmq.nodes.memory.connection_writers bytes consumed by processes responsible for serialisation of outgoing protocol frames and writing to client connection sockets 1
rabbitmq.nodes.memory.mnesia bytes consumed by virtual hosts, users, permissions, queue metadata and state, exchanges, bindings, runtime parameters 1
rabbitmq.nodes.memory.msg_index bytes consumed by the message index 1
rabbitmq.nodes.memory.other_ets bytes consumed by other in-memory tables besides those belonging to stats and internal databases 1
rabbitmq.nodes.memory.other_proc bytes consumed by other in-memory processes 1
rabbitmq.nodes.memory.other_system bytes consumed by other in-memory system processes 1
rabbitmq.nodes.memory.plugins bytes consumed by all rabbitmq plugins 1
rabbitmq.nodes.memory.queue_procs bytes consumed by queue masters, indices and messages kept in memory 1
rabbitmq.nodes.memory.queue_slave_procs bytes consumed by queue mirrors, indices and messages kept in memory 1
rabbitmq.nodes.mem_used memory consumed in bytes
rabbitmq.nodes.mem_used_details.rate change per second of the mem_used counter
rabbitmq.nodes.mnesia_disk_tx_count number of Mnesia transactions which have been performed that required writes to disk
rabbitmq.nodes.mnesia_disk_tx_count_details.rate change per second of the mnesia_disk_tx_count counter
rabbitmq.nodes.mnesia_ram_tx_count number of Mnesia transactions which have been performed that did not require writes to disk
rabbitmq.nodes.mnesia_ram_tx_count_details.rate change per second of the mnesia_ram_tx_count counter
rabbitmq.nodes.proc_used_details.rate change per second of the proc_used counter
rabbitmq.nodes.queue_index_read_count number of records read from the queue index
rabbitmq.nodes.queue_index_read_count_details.rate change per second of the queue_index_read_count counter
rabbitmq.nodes.queue_index_write_count number of records written to the queue index
rabbitmq.nodes.queue_index_write_count_details.rate change per second of the queue_index_write_count counter
rabbitmq.nodes.sockets_used_details.rate change per second of the sockets_used counter
rabbitmq.queues.disk_reads total number of times messages have been read from disk by this queue since it started
rabbitmq.queues.disk_writes total number of times messages have been written to disk by this queue since it started
rabbitmq.queues.message_bytes sum of the size of all message bodies in the queue (bytes)
rabbitmq.queues.message_bytes_persistent like message_bytes but counting only those messages which are persistent
rabbitmq.queues.message_bytes_ram like message_bytes but counting only those messages which are in RAM
rabbitmq.queues.message_bytes_ready like message_bytes but counting only those messages ready to be delivered to clients
rabbitmq.queues.message_bytes_unacknowledged like message_bytes but counting only those messages delivered to clients but not yet acknowledged
rabbitmq.queues.messages_persistent total number of persistent messages in the queue (will always be 0 for transient queues)
rabbitmq.queues.messages_ram total number of messages which are resident in ram
rabbitmq.queues.messages_ready_ram number of messages from messages_ready which are resident in ram
rabbitmq.queues.message_stats.disk_reads total number of times messages have been read from disk by this queue since it started
rabbitmq.queues.message_stats.disk_reads_details.rate change per second of the disk_reads counter
rabbitmq.queues.messages_unacknowledged_ram number of messages from messages_unacknowledged which are resident in ram
rabbitmq.vhosts.message_stats.confirm count of messages confirmed
rabbitmq.vhosts.message_stats.confirm_details.rate change per second of the confirm counter
rabbitmq.vhosts.message_stats.deliver_get sum of deliver, deliver_no_ack, get and get_no_ack counters
rabbitmq.vhosts.message_stats.deliver_get_details.rate change per second of deliver_get counter
rabbitmq.vhosts.message_stats.get_no_ack count of messages delivered in no-acknowledgement mode in response to basic.get
rabbitmq.vhosts.message_stats.get_no_ack_details.rate change per second of get_no_ack counter
1 RabbitMQ v3.7.0+ breaking changes to memory use API