rabbitmq-server/deps/rabbitmq_tracing
Loïc Hoguin bbfa066d79
Cleanup .gitignore files for the monorepo
We don't need to duplicate so many patterns in so many
files since we have a monorepo (and want to keep it).

If I managed to miss something or remove something that
should stay, please put it back. Note that monorepo-wide
patterns should go in the top-level .gitignore file.
Other .gitignore files are for application or folder-
specific patterns.
2024-06-28 12:00:52 +02:00
..
priv Tracing: expose two more settings to rabbitmq.conf 2024-06-24 16:10:47 -04:00
src (c) year bumps 2024-01-01 22:02:20 -05:00
test rabbitmq_tracing: test suite cosmetics 2024-06-24 16:13:41 -04:00
BUILD.bazel Tracing: expose two more settings to rabbitmq.conf 2024-06-24 16:10:47 -04:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE Replace @rabbitmq.com addresses with rabbitmq-core@groups.vmware.com 2023-06-20 15:40:13 +04:00
LICENSE-MPL-RabbitMQ
Makefile
README.md
app.bzl Tracing: expose two more settings to rabbitmq.conf 2024-06-24 16:10:47 -04:00

README.md

RabbitMQ (Message) Tracing Plugin

This is an opinionated tracing plugin that extends RabbitMQ management UI. It logs messages passing through vhosts with enabled tracing to a log file.

Usage

This plugin ships with RabbitMQ. Enabled it with rabbitmq-plugins enable, then see a "Tracing" tab in the management UI.

Configuration

Configuration options are under the rabbitmq_tracing app (config section, if you will):

  • directory: controls where the log files go. It defaults to "/var/tmp/rabbitmq-tracing".
  • username: username to be used by tracing event consumers (default: <<"guest">>)
  • password: password to be used by tracing event consumers (default: <<"guest">>)

Performance

TL;DR: this plugin is intended to be used in development and QA environments. It will increase RAM consumption and CPU usage of a node.

On a few year old developer-grade machine, rabbitmq-tracing can write about 2000 msg/s to a log file. You should be careful using rabbitmq-tracing if you think you're going to capture more messages than this. Any messages that can't be logged are queued.

The code to serve up the log files over HTTP is not at all sophisticated or efficient, it loads the whole log into memory. If you have large log files you may wish to transfer them off the server in some other way.

HTTP API Endpoints

GET            /api/traces
GET            /api/traces/node/<node>
GET            /api/traces/<vhost>
GET            /api/traces/node/<node>/<vhost>
GET PUT DELETE /api/traces/<vhost>/<name>
GET PUT DELETE /api/traces/node/<node>/<vhost>/<name>
GET            /api/trace-files
GET            /api/trace-files/node/<node>
GET     DELETE /api/trace-files/<name>    (GET returns the file as text/plain)
GET     DELETE /api/trace-files/node/<node>/<name>    (GET returns the file as text/plain)

Example for how to create a trace using RabbitMQ HTTP API:

curl -i -u guest:guest -H "content-type:application/json" -XPUT \
     http://localhost:15672/api/traces/%2f/my-trace \
     -d'{"format":"text","pattern":"#", "max_payload_bytes":1000,
         "tracer_connection_username":"guest", "tracer_connection_password":"guest"}'

The format and pattern fields are mandatory.

tracer_connection_username and tracer_connection_password control what credentials the tracing connection will use. Both are optional and default to the configured plugin values.

max_payload_bytes is optional (omit it to prevent payload truncation).