Logs, metrics and traces: three views that together explain what a system is doing.
Observability is how well you can understand what is happening inside a running system by looking at what it sends out. The three classic kinds of output are metrics, logs and traces. They are called the three pillars.
When a program runs on your laptop you can add a print statement or open a debugger. In production, the code runs on many machines that you cannot touch, for users you cannot see. The only way to understand it is to make the system report on itself. A system that reports well is observable.
Monitoring and observability are close cousins. Monitoring watches for problems you already know about ("alert if the error rate is above 5%"). Observability is the ability to ask new questions about a problem you did not predict ("why are only users in one country slow?"). Good observability makes monitoring easy, but not the other way around.
| Pillar | What it is | Best question it answers | Cost and limit |
|---|---|---|---|
| Metrics | Numbers measured at regular intervals and stored as time series | Is something wrong? How much? Is it getting worse? | Cheap and fast. No detail about single requests. Too many label values (high cardinality) makes it costly. |
| Logs | Timestamped records of single events, as text or JSON | What exactly happened, and what was the error? | Rich detail, but large. Costly to store and search. Hard to connect across services without an ID. |
| Traces | A tree of timed steps (spans) for one request across services | Where did the time or the failure happen? | Needs every service to pass a trace ID along. Often sampled, so some requests are not recorded. |
At 14:02 customers start seeing an error page at checkout.
The minutes are made-up round numbers to show the idea, not measurements. Real teams can often answer more questions with one pillar than shown here, but usually slower.
| Term | Meaning in easy words |
|---|---|
| Observability | How well you can understand a system's inside state from the data it produces |
| Monitoring | Watching known signals and alerting when they cross a limit |
| Telemetry | The data a system sends out: metrics, logs, traces and more |
| Metric | A number measured over time, such as requests per second |
| Log | A timestamped record of one event |
| Trace | The full journey of one request through the system |
| Span | One timed step inside a trace, such as a database call |
| Trace ID / request ID | A unique label passed along a request so all its data can be joined |
| Cardinality | The number of different values a label can take. Very high cardinality makes metrics costly |
| Sampling | Keeping only a share of traces or logs to save cost |
| OpenTelemetry | An open standard and set of tools for producing and sending telemetry |
| Choice | We gain | We lose |
|---|---|---|
| Log everything | Full detail to look back on | High cost, noise and a risk of leaking data |
| Log little | Low cost, quiet logs | Gaps when you need a detail the most |
| Trace every request | Complete picture of every call | Large cost and extra delay in each request |
| Sample traces | Low cost, still a good picture on average | A rare failing request may not be recorded |
| Many metric labels | Rich slicing by region, version, customer | Cardinality explosion and a big bill |
| One vendor for all three | Everything in one place, easy links | Lock-in and a single bill that grows fast |