The Three Pillars of Observability Explained
When software runs across several services, machines and networks, you cannot simply read the code and know what it is doing. You need evidence from the running system. Observability is the ability to understand what is happening inside a system by looking at the data it produces. The more precisely you can ask new questions without changing the code, the more observable it is.
A popular way to organize that data is the idea of three pillars: logs, metrics and traces. Each one answers different kinds of questions, and each has weaknesses the others cover. Understanding what each does will help you decide what to collect and when to reach for which one.
Observability Versus Monitoring
The two terms overlap, but they are not identical. Monitoring watches for known problems: you decide in advance what to measure and what thresholds matter, then get alerted. Observability is broader, aiming to let you investigate unknown problems, the ones you did not predict.
A simple picture: monitoring tells you that something is wrong, while observability helps you find out why. You need both. Dashboards and alerts built from metrics detect trouble, and richer data lets you dig into causes.
Pillar One: Logs
A log is a timestamped record of a discrete event. An application writes a line when it starts, handles a request, fails to connect or throws an error. Logs are the oldest and most familiar form of telemetry.
Strengths:
- They carry detailed, specific context, such as an error message and the values involved.
- They are easy to produce and require little planning.
- They are ideal for answering "what exactly happened in this case?"
Weaknesses:
- Volume grows quickly, which raises storage and search costs.
- Plain text is hard to analyze, so structured fields help considerably.
- A single log line rarely shows how an event relates to others across services.
Use logs when you need the full detail of a particular failure, such as the exact exception and input that caused a request to fail.
Pillar Two: Metrics
A metric is a numeric measurement collected over time, such as requests per second, memory in use, error count or queue depth. Instead of recording each event, metrics summarize them, usually as counters, gauges or histograms.
Strengths:
- They are compact, so storing months of history is affordable.
- They suit dashboards, trend analysis and alerting.
- They show the overall health and behavior of a system at a glance.
Weaknesses:
- They lose detail by design. A rising error rate tells you that errors increase, not which user or request failed.
- Adding labels with many unique values can make them costly.
- They show symptoms, not always causes.
Use metrics for questions like "is latency getting worse?" or "how many errors per minute are occurring right now?" They are the usual starting point of an investigation and the basis of alerts.
Pillar Three: Traces
A trace follows a single request as it travels through the many components of a system. It is made of spans, each representing one unit of work, such as a call to a database or another service. Spans record start time, duration and relationships, forming a tree that shows the path and timing of the request.
Strengths:
- They reveal where time is spent across services.
- They show dependencies and how failures propagate.
- They connect events that logs and metrics alone would scatter.
Weaknesses:
- They require instrumentation of every service and propagation of context between them.
- Recording every request is expensive, so teams often sample.
- They are less useful in a simple, single-process application.
Use traces to answer "why was this particular request slow?" and "which downstream service caused this error?"
How the Pillars Work Together
The real power appears when you combine them in one investigation. Consider a typical flow:
- An alert fires from a metric: error rate on the checkout service has climbed.
- A dashboard of metrics shows that only requests to one region are affected, starting at a specific time.
- A trace from a failing request shows that a call to the payment service is timing out after a long wait.
- The logs for that payment service span reveal the exact error: connections to its database are being refused.
Each pillar narrowed the search, and none could have done the whole job alone. To make this smooth, connect them with shared identifiers. Put the trace ID into log entries so you can jump from a trace to the matching logs, and use consistent service names and labels across all three types.
Beyond Three Pillars
Some practitioners point out that the three-pillar model is a useful teaching frame rather than a complete definition. Other signals matter too: profiles that show where code spends CPU time, events that mark deployments and configuration changes, and real-user data from browsers. The underlying goal is to collect rich, correlated data, not to tick off three boxes.
Practical Advice for Getting Started
- Begin with metrics and structured logs. They give the most value for the least effort.
- Add tracing where the architecture demands it, especially once you have several services calling each other.
- Adopt an open standard for instrumentation, such as OpenTelemetry, which works across languages and lets you change backends later.
- Decide what you will do with the data. Every signal should support a question, an alert or a decision.
- Watch the cost. Use sampling, retention limits and sensible log levels.
Frequently Asked Questions
Do I need all three pillars from the beginning?
No. A small application can start with basic metrics and structured logs, which cover most day-to-day needs. Tracing becomes valuable as the number of services grows and requests cross boundaries. Add each signal when you have a clear question that the existing data cannot answer.
What is the difference between a metric and a log?
A log records an individual event with detail, while a metric is a numeric summary measured over time. If you want to know the exact error for one request, look at the log. If you want to know how many errors happened per minute, look at the metric.
Is OpenTelemetry required for observability?
It is not required, but it is a widely adopted open standard that provides common ways to produce logs, metrics and traces. Using it reduces lock-in to any one vendor or tool and lets you reuse instrumentation if you decide to switch where the data is stored and analyzed.