Architectural Breakdown & AnalysisFAANG Aligned
In microservice architectures, a single user click triggers calls across dozens of services. Distributed tracing tracks request execution paths across boundaries.
Context Propagation Headers (W3C Trace Context)
Services inject HTTP headers into downstream RPC requests:
traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01- Trace ID (`4bf9...`): Unique identifier shared across the entire call graph.
- Span ID (`00f0...`): Unique identifier for an individual operation within a service.
Head-Based vs Tail-Based Sampling
- Head-Based Sampling: Decides to sample a trace at the initial API Gateway. Efficient, but might miss rare errors.
- Tail-Based Sampling: Collects all spans first, sampling 100% of traces containing HTTP 5xx errors or latency anomalies.
NOTE — Standard Framework
Standardize telemetry instrumentation across languages using OpenTelemetry (OTel).
Key Architectural Comparison
| Tracing Primitive | Scope | Information Contained | Propagation Header |
|---|---|---|---|
| Trace ID | Entire end-to-end request lifecycle across all microservices. | Globally unique 64/128-bit identifier. | traceparent (W3C standard) |
| Span ID | Single unit of contiguous work within a specific microservice. | Start time, duration, service name, tags, error flags. | traceparent |
| Baggage | Cross-cutting user/tenant context passed across RPC boundaries. | User ID, tenant tier, feature flags. | baggage |