Prompt
How do I follow one request through multiple services
Latest observation
Oct 28, 2026
OpenAI APIWeb search: off
To follow one request through multiple services, you usually want distributed tracing.
What to do
- Generate or receive a trace ID at the first entry point.
- Pass that ID along in every downstream request, typically in headers.
- Create spans for each service call so you can see timing and dependencies.
- Use a tracing backend to collect and visualize the chain.
Common standard
The most common approach today is W3C Trace Context:
traceparentheader: carries the trace and parent span infotracestateheader: optional vendor-specific metadata
Example:
traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-00
Typical flow
- Service A receives request
- It extracts trace headers
- It starts a new span as the parent
- It calls Service B and injects the same trace context
- Service B continues the trace with its own child span
- Repeat for Service C, database calls, queues, etc.
Tools that help
- OpenTelemetry for instrumentation
- Jaeger, Zipkin, Grafana Tempo, or Datadog for tracing storage/visualization
Important tips
- Use a correlation ID if you only need logging correlation, but prefer distributed tracing for end-to-end visibility.
- Make sure logs include the trace ID too, so you can jump from logs to trace.
- If requests go through async systems or message queues, propagate the trace context in message headers/metadata.
Minimal example
If Service A calls Service B:
X-Request-Id: abc123
traceparent: 00-...
Then B logs and forwards those headers onward.
If you want, I can show:
- an example in Python/Java/Node/Go
- how to set this up with OpenTelemetry
- how to do it for HTTP + Kafka/RabbitMQ