• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..01-Dec-2021-

priv/www/js/tmpl/H01-Dec-2021-175172

src/H01-Dec-2021-780529

BUILD.bazelH A D01-Dec-20211.3 KiB7156

CODE_OF_CONDUCT.mdH A D01-Dec-20212.3 KiB4535

CONTRIBUTING.mdH A D01-Dec-20214.7 KiB12486

LICENSEH A D01-Dec-2021212 64

LICENSE-MPL-RabbitMQH A D01-Dec-202116.3 KiB374293

MakefileH A D01-Dec-2021800 3121

README.mdH A D01-Dec-20212.5 KiB6849

README.md

1# RabbitMQ (Message) Tracing Plugin
2
3This is an opinionated tracing plugin that extends RabbitMQ management UI.
4It logs messages passing through vhosts [with enabled tracing](https://www.rabbitmq.com/firehose.html) to a log
5file.
6
7## Usage
8
9This plugin ships with RabbitMQ. Enabled it with `rabbitmq-plugins enable`,
10then see a "Tracing" tab in the management UI.
11
12
13## Configuration
14
15Configuration options are under the `rabbitmq_tracing` app (config section,
16if you will):
17
18 * `directory`: controls where the log files go. It defaults to "/var/tmp/rabbitmq-tracing".
19 * `username`: username to be used by tracing event consumers (default: `<<"guest">>`)
20 * `password`: password to be used by tracing event consumers (default: `<<"guest">>`)
21
22## Performance
23
24TL;DR: this plugin is intended to be used in development and QA environments.
25It will increase RAM consumption and CPU usage of a node.
26
27On a few year old developer-grade machine, rabbitmq-tracing can write
28about 2000 msg/s to a log file. You should be careful using
29rabbitmq-tracing if you think you're going to capture more messages
30than this. Any messages that can't be logged are queued.
31
32The code to serve up the log files over HTTP is not at all
33sophisticated or efficient, it loads the whole log into memory. If you
34have large log files you may wish to transfer them off the server in
35some other way.
36
37## HTTP API Endpoints
38
39```
40GET            /api/traces
41GET            /api/traces/node/<node>
42GET            /api/traces/<vhost>
43GET            /api/traces/node/<node>/<vhost>
44GET PUT DELETE /api/traces/<vhost>/<name>
45GET PUT DELETE /api/traces/node/<node>/<vhost>/<name>
46GET            /api/trace-files
47GET            /api/trace-files/node/<node>
48GET     DELETE /api/trace-files/<name>    (GET returns the file as text/plain)
49GET     DELETE /api/trace-files/node/<node>/<name>    (GET returns the file as text/plain)
50```
51
52Example for how to create a trace using [RabbitMQ HTTP API](https://www.rabbitmq.com/management.html):
53
54```
55curl -i -u guest:guest -H "content-type:application/json" -XPUT \
56     http://localhost:15672/api/traces/%2f/my-trace \
57     -d'{"format":"text","pattern":"#", "max_payload_bytes":1000,
58         "tracer_connection_username":"guest", "tracer_connection_password":"guest"}'
59```
60
61The format and pattern fields are mandatory.
62
63`tracer_connection_username` and `tracer_connection_password` control what credentials the tracing
64connection will use. Both are optional and default to the configured
65plugin values.
66
67`max_payload_bytes` is optional (omit it to prevent payload truncation).
68