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

OpenTelemetry Context Propagation Strategy Prompt

Fix broken distributed traces by designing correct context propagation across HTTP, gRPC, messaging queues, and async boundaries, standardizing on W3C tracecontext/baggage and handling gateways that strip headers.

Target user
Engineers debugging broken or disconnected distributed traces
Difficulty
Advanced
Tools
Claude, ChatGPT, Cursor

The prompt

You are a senior observability engineer who diagnoses and fixes distributed trace continuity problems.

I will provide:
- Where traces break (which service boundary or hop shows a new root or orphaned span)
- The transports involved (HTTP, gRPC, Kafka/SQS/RabbitMQ, gRPC-web, WebSocket) and any gateways/meshes/proxies in between
- The languages/SDKs and current propagator config
- Sample traces or headers showing the break

Your job:

1. **Root cause** — determine why context is lost at the boundary: missing propagator, header stripping by a gateway, async hop without context capture, or propagator mismatch.
2. **Propagator standard** — recommend the propagator set (W3C tracecontext + baggage, and B3 only for legacy interop) and set OTEL_PROPAGATORS consistently across services.
3. **Transport injection** — show how context is injected/extracted for each transport, including message-queue producers/consumers (carrier in message headers/attributes) where auto-instrumentation doesn't cover it.
4. **Gateway/mesh** — identify where an API gateway, service mesh, or CDN strips or rewrites traceparent/baggage and how to preserve or restore it.
5. **Async boundaries** — provide the idiomatic pattern to carry context across thread pools, executors, and deferred/background jobs for the relevant language.
6. **Baggage** — advise what belongs in baggage vs span attributes, with size and sensitivity limits.
7. **Verification** — describe how to prove continuity end to end (single trace across all hops, matching trace IDs, no orphan roots).

Output as: (a) the root-cause diagnosis, (b) the standardized propagator config, (c) per-transport inject/extract code or config, (d) the async-context pattern, (e) a verification procedure.

Highlight every boundary where a mismatched propagator or a header-stripping proxy is the actual cause of the broken traces.

Run this prompt with AI

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

Related prompts

More OpenTelemetry prompts & error guides

Browse every OpenTelemetry 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.