Observability
Observability is how well you can understand what’s happening inside a system from the data it emits, including problems you didn’t predict. Monitoring tells you that something is wrong: a dashboard turns red. Observability helps you find out why, by letting you ask new questions of the data without shipping new code.
In distributed systems, where one user request may touch dozens of services, this isn’t optional. Without it, every incident becomes a guessing game.
Diagram
Section titled “Diagram”- Services and infrastructure emit telemetry in one open format, with shared context such as trace IDs.
- A collector enriches, samples and routes it to the right storage for each signal.
- Alerts fire on user-facing service level objectives, and engineers move from a metric to the trace and logs behind it.
The three signals, and how they connect
Section titled “The three signals, and how they connect”| Signal | Answers | Strength | Watch out for |
|---|---|---|---|
| Metrics | How many? How fast? How full? | Cheap to store, great for alerting and trends | High-cardinality labels (like user ID) can explode cost |
| Logs | What exactly happened? | Rich detail for one event | Volume and cost; unstructured text is hard to query |
| Traces | Where did the time go across services? | Shows the path and latency of one request end to end | Needs context propagation through every hop; usually sampled |
The real power comes from correlation: the same trace ID in a log line, an exemplar on a metric and a span in a trace lets an engineer jump between them in seconds.
How it works
Section titled “How it works”- Instrument with OpenTelemetry. OpenTelemetry (OTel) is the CNCF standard for APIs, SDKs and a wire protocol (OTLP) for metrics, logs and traces. Instrument once and send anywhere.
- Propagate context. W3C Trace Context headers carry trace IDs across HTTP calls and message queues, so a trace survives every hop.
- Use a collector. The OpenTelemetry Collector receives, processes (redaction, enrichment, sampling) and exports telemetry. Backends can change without redeploying services.
- Structured logs. Log JSON with consistent fields, including the trace ID, not free-form text.
- Alert on symptoms users feel. Define service level indicators (SLIs) such as request success rate and latency, set service level objectives (SLOs), and alert when the error budget burns too fast, not on every CPU spike.
- Sample deliberately. Keep all errors and slow requests, and a fraction of the rest. Tail-based sampling in the collector makes that possible.
- Faster incident resolution: less time finding the problem, more time fixing it.
- Vendor neutrality: with OpenTelemetry, changing observability vendors doesn’t mean re-instrumenting.
- Better decisions: real data on performance, usage and reliability.
- Cost: telemetry volume grows fast, and observability can become one of the largest platform bills.
- Effort: instrumentation, context propagation and sensible SLOs take work in every service.
- Noise: too many alerts train people to ignore them.
When to use it
Section titled “When to use it”- Any production system, and especially distributed systems: microservices, event-driven architectures and anything with many third-party calls.
- As a platform capability, so every new service gets it by default.
When to avoid it
Section titled “When to avoid it”Don’t build a custom telemetry pipeline for a single small application. A managed service with auto-instrumentation is enough. But still use structured logs and define what “working” means.
Common pitfalls
Section titled “Common pitfalls”- Logs everywhere, traces nowhere, making cross-service problems almost impossible to follow.
- Alerting on causes, not symptoms: pages for high CPU while users see nothing, and silence when users can’t check out.
- Sensitive data in logs, such as tokens, card numbers or health information.
- No ownership: dashboards nobody looks at and alerts routed to nobody.
Related patterns
Section titled “Related patterns”Further reading
Section titled “Further reading”- OpenTelemetry documentation (opens in a new tab)
- W3C, Trace Context (opens in a new tab)
- Google, Site Reliability Engineering: Service level objectives (opens in a new tab)
- Charity Majors, Liz Fong-Jones and George Miranda, Observability Engineering (O’Reilly, 2022)
Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.