Menu

Firehose Tracer

Overview

Sometimes, during development or debugging, it's useful to be able to see every message that is published, and every message that is delivered. RabbitMQ has a "firehose" feature, where the administrator can enable (on a per-node, per-vhost basis) an exchange to which publish- and delivery-notifications should be CCed.

These notifications are close to what's happening on the wire - for example you will see unacked messages.

When the feature is switched off, it has no effect on performance; when it is switched on, performance will drop somewhat due to additional messages being generated and routed.

Enabling the firehose

Before enabling the feature, decide which node, and which vhost, should have it enabled. The examples below assume the default vhost, "/", and the default node "rabbit@(hostname)". Use the -n argument to specify a node other than, and the -p argument to specify another vhost.

Next, within the chosen vhost declare queues, bind them to the topic exchange amq.rabbitmq.trace, and begin consuming.

Finally, enable firehose tracing with

rabbitmqctl trace_on -p [virtual host]

.

Disabling the firehose

To disable Firehose, run

rabbitmqctl trace_off -p [virtual host]

Don't forget to clean up any queues that were used to consume events from the Firehose.

Note that the firehose state is not persistent; it will default of off at server start time.

Firehose Event Message Format

The firehose publishes messages to the topic exchange amq.rabbitmq.trace. In this section we refer to the messages consumed and inspected via the Firehose mechanism as "traced messages".

Traced message routing key will be either "publish.{exchangename}" (for messages entering the node), or "deliver.{queuename}" (for messages that are delivered to consumers).

Traced message headers containing metadata about the original message:

HeaderTypeDescription
exchange_name longstr name of the exchange to which the message was published
routing_keys array routing key plus contents of CC and BCC headers
properties table content properties
node longstr Erlang node on which the trace message was generated
redelivered signedint whether the message has its redelivered flag set (messages leaving the broker only)

Traced message body corresponding to the body of the original message.

Tracing plugin

The rabbitmq_tracing plugin builds on top of the tracer and provides a GUI to capture traced messages and log them in text or JSON format files.

Getting Help and Providing Feedback

If you have questions about the contents of this guide or any other topic related to RabbitMQ, don't hesitate to ask them on the RabbitMQ mailing list.

Help Us Improve the Docs <3

If you'd like to contribute an improvement to the site, its source is available on GitHub. Simply fork the repository and submit a pull request. Thank you!