Tracing Fundamentals
Overview
Distributed tracing tracks a request across service boundaries, revealing latency contributors and failure points.
Trace Model
- Trace: full request journey
- Span: timed operation within a trace
- Context propagation: trace and span identifiers across calls
sequenceDiagram
participant Client
participant API
participant Payments
participant DB
Client->>API: Request
API->>Payments: Charge
Payments->>DB: Write transaction
DB-->>Payments: OK
Payments-->>API: OK
API-->>Client: Response
Practical Example
traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
Production Example
During latency incidents, traces quickly identify whether delays originate in application code, database calls, or external APIs.
Common Pitfalls
- Missing context propagation between services
- Sampling too aggressively and losing critical traces
- Capturing traces without linking to logs and metrics
Key Takeaways
- Tracing provides request-level visibility in distributed systems.
- Propagation and sampling strategy determine trace usefulness.
- Correlating signals across telemetry types accelerates diagnosis.