How it works · 36 of 38 Advanced

What is observability: logs, metrics and traces?

Logs, metrics and traces

Observability: Observability is being able to tell, from the outside, why a running system behaves as it does, using three records: metrics (numbers over time, which show that something is wrong and how much), logs (one line per event, which show what happened to a particular request) and traces (one request's path through every service with the time spent in each, which show where); averages hide the slow few, so you watch the slowest 1% (the 99th percentile), not the mean.

Loading the animation…

Say it like this Metrics tell you something is wrong, logs tell you what happened to one request, and a trace tells you where the time went; join them with one request id, and watch the slowest 1%, because the average hides exactly the customers who are complaining.

Under the hood — for builders
Real case: why the average hides it
Dean and Barroso (Google): a server answers in about 10 ms, but 1 request in 100 takes a second. Fan a request out to many:
Percentile
p99 is the time within which 99% of requests finish: watch it, not the average.
The three signals
Each answers a different question; one shared trace id joins them:
SLO
The target you set yourself, e.g. 99% of checkouts under 1 second.
Alert on symptoms
Page people for what customers feel (slow checkouts vs the SLO); put causes like CPU on dashboards.
Watch out
Logs copy personal data (E7): log ids, not phone numbers. Keep every slow and failed trace, sample the rest.
Sources
Dean & Barroso, "The Tail at Scale", CACM 56(2), 2013 · Google SRE book, ch. 6, "Monitoring Distributed Systems" (read November 2026).

What happens in the observability animation, step by step?

  1. A customer says checkout took 8 seconds. The engineer on call has three instruments: a gauge of numbers over time (metrics), a logbook of events (logs), and a spool that records one request's whole path (a trace).
  2. First, the gauge. Average checkout time: 120 milliseconds, comfortably green. By the average, nothing is wrong. But an average hides the slow few.
  3. Your turn: tap each instrument. Which one shows where this customer's 8 seconds went?
  4. Why the slow few matter: a page often waits on many services at once. Google's engineers worked it out: if each server is slow one time in a hundred and a page needs a hundred of them, 63 pages in 100 are slow.
  5. So connect the three: stamp every log line with the request's trace id, watch the 99th percentile instead of the average, and alert on what customers feel, a slow checkout, not on a busy processor.
  6. One more thing in that logbook: customers' phone numbers and card details. Logs copy personal data everywhere. Who may keep it, where, and for how long? Next: data privacy and residency.

What everyday example explains observability?

A hospital ward. The bedside monitor plots pulse and temperature over time (metrics); the nurses' notes record what was done and when (logs); a dye scan follows one flow through the body to the blockage (a trace); and a ward average of "temperature normal" can hide the one patient with a fever (the average vs the 99th percentile).

Why should a team care about observability?

When you build a service, decide what you will need to see at 2 a.m. before you ship: emit metrics, logs and traces through one standard (OpenTelemetry) with a shared request id, set alerts on the 99th percentile and on errors customers feel, and budget for it, because log storage is often a large line on the cloud bill.