rabbitmq-server/deps/rabbitmq_tracing
Philip Kuryloski efcd881658 Use rules_erlang v2
bazel-erlang has been renamed rules_erlang. v2 is a substantial
refactor that brings Windows support. While this alone isn't enough to
run all rabbitmq-server suites on windows, one can at least now start
the broker (bazel run broker) and run the tests that do not start a
background broker process
2022-01-18 13:43:46 +01:00
..
priv/www/js Naming 2018-07-30 04:16:04 +03:00
src Fix all uses of file:read_file/1 2022-01-03 11:33:36 -08:00
test Bump (c) year 2021-01-22 09:00:14 +03:00
.gitignore Git: Ignore copied CLI 2019-12-12 15:09:22 +01:00
.travis.yml Travis CI: Update config from rabbitmq-common 2020-03-04 14:24:32 +01:00
BUILD.bazel Use rules_erlang v2 2022-01-18 13:43:46 +01:00
CODE_OF_CONDUCT.md URL Cleanup 2019-03-20 03:24:41 -05:00
CONTRIBUTING.md Add github templates 2019-07-01 06:59:36 -07:00
LICENSE Switch to MPL2 2020-07-15 02:46:53 +03:00
LICENSE-MPL-RabbitMQ Revert drop of Exhibit B on MPL 2.0 2020-07-20 17:04:47 +01:00
Makefile Remove duplicate rabbitmq-components.mk and erlang.mk files 2021-03-22 15:40:19 +01:00
README.md URL Cleanup 2019-03-20 03:24:41 -05: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).