OpenTelemetry cheatsheet
A one-page reference for OpenTelemetry. For instrumentation deep-dives and Collector pipeline config, see the complete guide.
๐ Full guide: OpenTelemetry โ Intermediate- Begin with the Spans & traces card
- Then the Context propagation and Three signals cards
- Treat the other 4 cards as lookups โ scan by card title when you need one
- Open the full guide when a card isn't enough
Spans & tracesโ
Trace (trace_id=abc123)
โโ span: HTTP GET /checkout 120ms
โโ span: validate-cart 15ms
โโ span: charge-card 80ms
โโ span: send-confirmation 10ms
A span has a name, start/end time, attributes, events, and status (OK/Error). A trace is a tree of spans sharing one trace ID.
Context propagationโ
The active SpanContext (trace_id, span_id, trace_flags) is injected
into outgoing request headers and extracted downstream so the next
service's span becomes a child of the caller's โ this is what stitches a
distributed trace together across services.
Three signalsโ
| Signal | Answers |
|---|---|
| Traces | where did the request go, and where was it slow |
| Metrics | how much / how often, aggregated over time |
| Logs | what exactly happened at a point in time |
Architecture: API, SDK, Collectorโ
- API โ vendor-neutral instrumentation surface your code calls.
- SDK โ the implementation (sampling, batching, exporting).
- Collector โ a separate process that receives, processes, and exports telemetry โ decouples your app from any specific backend.
Instrumentation: auto vs manualโ
Auto-instrumentation (agent/library hooks) gets you 80% for free with zero code changes. Manual spans/attributes fill the gap for business-specific context auto-instrumentation can't know about.
Samplingโ
Head-based sampling decides at trace start (cheap, may miss rare errors). Tail-based sampling decides after seeing the full trace (catches errors/ slow traces reliably, but needs the Collector to buffer).
Common pitfallsโ
- No context propagation across an async boundary (queue, background job) โ broken traces.
- Over-instrumenting โ noisy, expensive traces nobody reads.
- Sampling too aggressively โ missing the rare error that mattered.