Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for RabbitMQ Difficulty: Advanced ClaudeChatGPTCursor

RabbitMQ Firehose Tracing Debug Plan Prompt

Use the firehose tracer and rabbitmq_tracing plugin to capture exactly what a broker did with a message — where it was published, how it routed, and why it was dropped or dead-lettered — without guessing from application logs.

Target user
Platform and backend engineers debugging routing and message-loss mysteries
Difficulty
Advanced
Tools
Claude, ChatGPT, Cursor

The prompt

You are a senior platform engineer who has used RabbitMQ's firehose tracer and the `rabbitmq_tracing` plugin to solve "the message vanished" and "it went to the wrong queue" mysteries. Help me capture the broker's-eye view of what actually happened to my messages.

I will provide:
- The symptom: messages published but never consumed, routed to the wrong queue, silently dropped, or dead-lettered unexpectedly [DESCRIBE]
- The topology involved: exchange types, bindings, routing keys, and any policies (alternate exchange, DLX, TTL) that could redirect a message [DESCRIBE]
- The vhost, and roughly the message rate on the affected exchange (so we size the trace safely) [DESCRIBE]
- What the application logs claim happened vs what consumers actually saw [DESCRIBE]

Your job:

1. **Choose the right tracing tool** — explain the difference between the low-level firehose (`rabbitmqctl trace_on`, which republishes every message to `amq.rabbitmq.trace`) and the `rabbitmq_tracing` plugin (a managed UI/file tracer built on the firehose with capture filters). Pick the one that fits the symptom and the message rate.

2. **Read publish vs deliver events** — clarify that firehose emits `publish.*` (message entering an exchange) and `deliver.*` (message leaving a queue to a consumer) events, each carrying the exchange, routing key, and headers. Show how comparing the two answers "did it route at all?" vs "did it route but never get delivered?".

3. **Trace safely under load** — the firehose duplicates every matching message, so it can double broker load and fill a trace queue fast. Design a bounded capture: enable it briefly, filter to the specific exchange/vhost, cap the trace queue with `max-length`/TTL, and turn it off immediately after reproducing. Never leave the firehose on in production.

4. **Correlate the trace with topology** — line up the captured routing key and exchange against the actual bindings (`rabbitmqctl list_bindings`) to see whether the binding you think exists really does, whether an alternate exchange caught an unroutable message, or whether a DLX/TTL policy re-routed it.

5. **Distinguish the failure classes** — from the trace, separate: never published (nothing in firehose = client-side problem), published but unroutable (publish event, no matching binding, possibly to an AE), routed but not delivered (deliver event never fires = consumer/queue issue), and delivered then dead-lettered (deliver + later DLX publish).

6. **Prove the fix** — after changing a binding, policy, or client, re-run the same bounded trace to confirm the message now takes the intended path, then disable tracing and clean up the trace queue.

Output as: (a) which tracer to use and the exact enable/filter/disable commands, (b) how to read publish vs deliver events for this symptom, (c) the correlation steps against bindings and policies, (d) the failure-class decision (where the message actually died), and (e) the verification trace.

The firehose republishes every matched message and can double broker load or fill a trace queue quickly. Enable it only long enough to reproduce, bound the trace queue with max-length/TTL, and always `trace_off` when done — a forgotten firehose is a production hazard.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Why this prompt works

Message-routing bugs are hard because the application only sees its own side: it published, and a consumer either got the message or didn’t. Everything in between — which exchange it hit, which binding matched, whether an alternate exchange or DLX quietly redirected it — is invisible from the app. This prompt reaches for the one tool that shows the broker’s actual behavior: the firehose, which emits a publish event when a message enters an exchange and a deliver event when it leaves a queue. Comparing those two events collapses a whole class of mysteries into a single question — did it route, and did it deliver?

It structures the investigation around failure classes rather than symptoms, because “the message vanished” has four completely different causes — never published, published-but-unroutable, routed-but-never-delivered, and delivered-then-dead-lettered — and the firehose events distinguish them cleanly. Correlating the captured routing key against real list_bindings output is what turns a guess about the topology into a fact.

The guardrails exist because the firehose is genuinely dangerous if left on: it duplicates every matched message, doubling load and filling the trace queue, and those captures contain full payloads. The prompt bounds the trace queue, keeps the capture short, and insists on trace_off and cleanup — so a debugging session doesn’t become the next incident.

Related prompts

More RabbitMQ prompts & error guides

Browse every RabbitMQ prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.