Prompt
I'm building a service mesh and need tracing across dependencies
Latest observation
Oct 19, 2026
OpenAI APIWeb search: off
To get tracing across dependencies in a service mesh, you want distributed tracing with context propagation turned on end-to-end.
Core idea
Each request gets a trace ID that follows it across services, and each service creates its own span inside that trace. Your mesh and apps need to pass trace context through every hop.
What you need
1) Standardize on a tracing format
Use one of:
- W3C Trace Context (
traceparent,tracestate) — recommended - B3 headers — common in older mesh setups
- Jaeger / Zipkin propagation — depending on tooling
If you’re starting fresh, prefer W3C Trace Context.
2) Instrument every service
Each service should:
- read incoming trace headers
- create a child span for its work
- inject trace headers on outbound calls
If possible, use OpenTelemetry SDKs/agents so you don’t have to wire this manually.
3) Make the mesh propagate headers
Your service mesh sidecars/proxies should:
- preserve tracing headers
- inject/extract trace context if configured
- generate spans for proxy-level hops if supported
This gives you visibility into:
- client → proxy
- proxy → service
- service → downstream service
4) Add a trace backend
Send traces to a collector/backend like:
- Jaeger
- Zipkin
- Grafana Tempo
- OpenTelemetry Collector in front of any backend
5) Correlate logs and metrics
Add the trace/span ID to logs so you can jump from a trace to a service log line.
Recommended architecture
- Apps: OpenTelemetry SDKs
- Mesh: Envoy-based sidecars or equivalent tracing support
- Collector: OpenTelemetry Collector
- Backend: Tempo / Jaeger / Zipkin
Important implementation points
- Propagate trace headers through HTTP, gRPC, and async messaging
- Don’t drop headers at gateways, queues, or retries
- Ensure all services agree on the same propagation format
- Sample traces carefully so you don’t overwhelm storage
- Use tail-based sampling if you want to keep only interesting traces
Common pitfalls
- Only tracing the mesh, not the application logic
- Forgetting propagation across message queues
- Mixed propagation formats causing broken traces
- Sampling too aggressively
- Not correlating logs with trace IDs
If you want a practical setup
A very common stack is:
- OpenTelemetry instrumentation
- Envoy sidecars in the mesh
- OpenTelemetry Collector
- Grafana Tempo + Grafana dashboards
If you want, I can also give you:
- a reference architecture diagram,
- a Kubernetes implementation plan, or
- config examples for Istio/Envoy/OpenTelemetry.