Lesson 20 · Observability

Why the p99 chart lies to you

Tied to Mission: Backend Depth — the mission's first success criterion is diagnosing a live issue from the shape of the symptom, and the baseline assessment's first evidence was "no specific tool/metric named." Every prior lesson taught a mechanism; this one teaches the instrument you use to see those mechanisms misbehave.

2am. The alert says response time is up. The dashboard shows the average is fine, CPU is flat, error rate is zero. The p99 line shows 5 seconds — but nobody trusts the p99, because the last engineer who "fixed" it averaged the per-instance p99s, and the chart has been wrong since. Even when the numbers are right, they don't tell you which service to blame. You have monitoring, but you can't see. Observability is the discipline of turning data into a diagnosis — and it starts with knowing which number means what, and which numbers lie.

The three pillars: metrics, logs, traces

Three data types, each answering a different question, each with a different cost:

The drill-down is the workflow that uses all three: an alert on a metric fires → you find a representative failing request → its trace shows which hop is slow → the logs for that span give the error. Metrics point, traces locate, logs explain.

RED vs USE: which numbers to watch, and where

Two acronyms organize monitoring by what you're measuring, and they cover different layers:

They pair with Google SRE's four golden signals — latency, traffic, errors, saturation — which are RED plus saturation folded in. Saturation is the interesting signal because it's the cause hiding behind the latency effect: queue depth growing is Lesson 13's Little's law firing, and it precedes the p99 rise by definition. Lesson 21 will lean on USE for the traffic path; Lesson 10's throughput-collapse curve is a saturation story; Lesson 11's "memory slowly growing" is a USE-style signal.

Percentile math: why averages hide the tail, and p99s lie when averaged

Latency is a distribution, not a number. A few very slow requests barely move the mean — 1% of requests at 5s barely lifts an average built from 99% at 50ms — so averages are structurally blind to the tail, and the tail is what users feel and what timeouts are built around (Lesson 7's timeouts are set from tail latency, not the mean). This is why p99/p999 exist: they describe the tail. Three traps that make them lie:

SLOs and error budgets: alarms that don't scream

A service level objective is a quantified promise: "99.9% of requests complete in under 200ms, measured over 30 days." Two numbers it unlocks:

Symptom shapes: the diagnosis habit the mission is built on

The mission's first success criterion — reason from the shape of the symptom before guessing — maps directly to what your charts show:

None of this replaces investigation — it orders it. The shape tells you which class of root cause to check first, and every class maps to a lesson in this curriculum. That's the entire point of the pass.

Check yourself

Three instances of your service report p99 latencies of 100ms, 200ms, and 300ms. What is the fleet-wide p99?
Right — a p99 of the merged fleet depends on the shape of each instance's distribution, not on the three p99 values. Merge the raw data first, then take the percentile. Any chart that averages per-instance percentiles is fiction. Not quite — percentiles don't average. The fleet p99 is the 99th percentile of all requests across all instances, which requires the merged raw distributions (or histograms). The numbers 100/200/300 alone are not enough to compute it. Re-read the percentile math section.

Try it for real

Hands-on

Generate latency data in Python and make the traps bite. 1) The tail: create 100,000 latencies ~ normal(50ms, 10ms) plus 100 outliers at 5s. The mean will read ~55ms while the p99 is ~5s — that's the average hiding the tail, and it's why p99 matters for timeouts. 2) The aggregation trap: split the data into 3 "instances," compute each instance's p99, and average them; then compute the true p99 of the merged data. Print both — the error is the chart you've probably been reading. 3) Burn rate: with an SLO of 99.9% over 30 days, compute the error budget in seconds; simulate a 10% error rate for 1 hour and a 0.1% error rate for 24 hours, and see how many days of budget each consumes — the first feels dramatic but burns little; the second is the silent killer that burn-rate alerting exists to catch.

Primary sources

The Google SRE book — "Monitoring Distributed Systems", "Service Level Objectives", and "Practical Alerting" — the source of the four golden signals, SLOs, error budgets, and burn rates. Tom Wilkie's "The RED Method" and Brendan Gregg's "The USE Method" define the two monitoring frameworks. Dean & Barroso, "The Tail at Scale", is the reference for why fan-out makes tails worse and what to do about it. Peter Bourgon's "Metrics, Tracing, and Logging" is the shortest good statement of what each pillar is for.

The lens is set. The final lesson of the pass points it at the most common recurring incident in the industry — what happens to a request during a deploy — Lesson 21: the traffic path.