Observability
A checkout turns slow at 14:05. Follow how a metric, a trace and four log lines, read together, lead from the symptom to the cause without opening the system.
In 30 seconds
Observability is how well you can work out what is happening inside a system by looking only at what it emits.
Three signals do most of the work. Metrics are numbers over time and show that something is wrong. Traces follow one request across services and show where. Logs are timestamped events and show what happened.
Monitoring checks for failures you thought of in advance. Observability is what lets you investigate the ones you did not.
Observability, step by step
An invented incident with round numbers. Real systems add other signals (events, profiles), and the line between monitoring and observability is drawn differently by different teams.
- Step 1: A slow checkout. A shop’s checkout is built from three services. Since 14:05 it answers in 4.2 seconds instead of 0.2. From outside you see only requests going in and responses coming out, not which part is slow or why.
- Step 2: Three kinds of output. Observability is how well you can work out a system’s inner state from what it emits. The term comes from control theory. In software the outputs are mostly three signals, each written by the services as they run.
- Step 3: Metrics: something is wrong. A metric is a number recorded at regular intervals. Here it is p99 latency: 99 of every 100 checkouts finish faster than this. It jumps from 0.2 s to 4.2 s and trips an alert. Metrics are cheap and show that something broke and when, but not where.
- Step 4: Traces: where it is slow. A trace follows one request through every service it touches and times each stretch, called a span. This slow checkout spent 80 ms in CART and 4000 ms in PAY, almost all of it in two calls to an outside bank. Now you know where to look.
- Step 5: Logs: what happened. A log is a timestamped record of one event, written by the code. Filtering PAY’s logs by the trace id shows the story: the bank did not answer within the 2000 ms limit, so PAY gave up, retried, and the second call took 1900 ms.
- Step 6: Linked, they explain it. Each signal alone is a fragment. The chart gave a time, the time led to a slow trace, and the trace id led to the right log lines. That chain only works if every signal carries shared context such as timestamps and trace ids.
- Step 7: Known and unknown failures. Monitoring watches for failures someone predicted and wrote a rule for. Nobody wrote a rule for “one bank is slow”. Because each request was recorded with details such as which bank it used, a brand new question can be asked of the data already collected.
Try it yourself
Learn this first
Learn next
- Distributed tracingFollowing one request through many services to find the slow hop. Intermediate
- SLIs, SLOs and SLAsWhat you measure, what you aim for and what you promise, with an error budget worked out. Beginner
- Chaos engineeringSwitching off a server on purpose to find a weakness before a real outage does. Intermediate
Spotted a mistake on this page?