Distributed Tracing with Micrometer Tracing and Zipkin
Fast recall
Quick revision
Core answer
Whether you understand the trace/span/baggage model, how context propagation works across HTTP and messaging, and how to interpret a distributed trace to diagnose latency
Confusing metrics (aggregated counters/gauges — Prometheus/Micrometer) with distributed tracing (per-request call graphs — Zipkin/Jaeger). They solve different problems and are complementary, not alternatives.
Explain B3 vs W3C TraceContext propagation header formats, describe sampling strategies (probabilistic vs rate-limiting), mention how to add custom span attributes for business context, and discuss correlating trace IDs in log aggregation (ELK/Grafana Loki)
Interview-ready guide
Interview answer
In microservices, a single request fans out across multiple services. Without distributed tracing, correlating logs across services is impossible. You see errors in isolation with no way to trace them back to the originating request.
Distributed tracing assigns a trace ID at the entry point and propagates it to every downstream service. Each service's work is a span with timing data. The full trace is a tree of spans.
Micrometer Tracing (replacing Sleuth in Boot 3) generates IDs and propagates context automatically via HTTP headers. Zipkin collects and visualizes the traces — its timeline view shows exactly which service is the bottleneck.
Sampling is critical — tracing 100% of requests in production generates enormous data. 10% sampling is common, but always force-trace errors.
The most practical benefit: trace ID in every log line via MDC. Search by trace ID to reconstruct the full request flow across all services.
In practice, I use Micrometer Tracing with Brave, Zipkin for visualization, and 10% sampling with 100% error tracing.
Distributed Tracing with Micrometer Tracing and Zipkin
Direct Answer
Micrometer Tracing (which replaced Spring Cloud Sleuth in Spring Boot 3) instruments Spring components to automatically propagate trace IDs and span IDs across HTTP calls and message queues. Spans are exported to Zipkin (or Jaeger/Tempo) for visualization. Each request gets a unique traceId that flows through every service in the call chain.
Common Mistakes & Pitfalls
Confusing metrics (aggregated counters/gauges — Prometheus/Micrometer) with distributed tracing (per-request call graphs — Zipkin/Jaeger). They solve different problems and are complementary, not alternatives.
Check your understanding
Answer these without looking back at the article.
- What is the difference between B3 propagation and W3C TraceContext propagation headers?
- How do you correlate distributed trace IDs with logs in Elasticsearch/Kibana?
- What is the difference between Zipkin and Jaeger for distributed tracing?
Related interview prep categories
2Want a guided curriculum order?
These modules are also sequenced in our flagship backend interview track — open it when you prefer an ordered path instead of browsing by topic.