Observability

Knowing what your system is actually doing in production — and agreeing, with numbers, on how good is good enough.

Observability in 30 seconds

  • Observability: can you understand what's happening inside your system from the outside? Three pillars: metrics, logs, traces.
  • SLI (Indicator): a number you actually measure — e.g. % of requests served under 200ms.
  • SLO (Objective): the target for that SLI — e.g. 99.9% of requests under 200ms.
  • Error budget: 100% − SLO = how much failure you're allowed. 99.9% = ~43 min/month to 'spend'.
  • The point: the budget turns 'is it reliable enough?' from an argument into a number both engineering and product agree on.
  • *Monitoring tells you what broke; observability helps you ask why.*

Flying a plane by its instruments

Picture a pilot in thick cloud. They can't see the ground, the horizon, or the weather ahead — yet they fly the plane safely for hours. How? The cockpit is covered in instruments: altitude, airspeed, heading, fuel, engine temperature. Each dial reports one fact about a thing the pilot can't directly see, and together they paint a picture of what the aircraft is actually doing right now.

A running production system is exactly that plane in the cloud. You can't see inside it — it's thousands of requests a second flowing through servers you'll never log into, in data centers on other continents. Observability is the cockpit. It's the set of instruments that let you understand what's happening inside the system purely from the signals it emits to the outside. Without them you're flying blind, and the first time you notice a problem is when a passenger (your user) starts screaming.

Why we even need this — you can't fix what you can't see

Before any of the vocabulary, sit with the pain that exists without observability. A system with no instrumentation isn't a calm system — it's a system where every problem is invisible until it's a catastrophe:

  • You find out from users, not from your tools. The first signal that checkout is broken is an angry tweet or a support ticket — hours after it started.
  • *You can't tell why anything is slow.* 'The site feels slow' has a thousand possible causes and no data to narrow them down. You're guessing.
  • Every deploy is a leap of faith. You ship a change and have no way to know if it quietly made the p99 latency twice as bad for 5% of users.
  • Arguments replace facts. 'Is it reliable enough?' becomes a shouting match between teams, because nobody has a number to point at.

Observability turns all of those from guesses into facts. The rest of this page builds it up in small steps: first the three kinds of instrument, then how to turn 'reliable enough' into an actual number teams can agree on.

Monitoring vs observability

These two words get used interchangeably, but the difference is the whole point. Monitoring answers questions you knew to ask in advance — 'is CPU over 80%?', 'is the error rate up?' You set up a dashboard and an alert ahead of time for a problem you anticipated.

Observability is the broader property of being able to ask new questions you didn't anticipate — 'why are only Android users in Europe seeing slow checkouts since 2pm?' — because the data you collect is rich enough to slice and explore after the fact. Monitoring is the smoke alarm you installed; observability is being able to walk through the house and figure out where and why the fire started. You get there with three kinds of signal working together.

The three pillars — three kinds of instrument

Back to the cockpit. A single dial can't tell you everything — the altimeter says nothing about fuel. Observability works the same way: it's built from three different kinds of signal, each answering a question the others can't. Together they're the three pillars.

PillarAnswersExample
MetricsHow much / how often? (cheap, aggregated)Requests/sec, error rate, p99 latency
LogsWhat exactly happened in this event?A detailed line for one failed request
TracesWhere did the time/failure go across services?This request spent 800ms in payments

Take each one in turn, because beginners mix them up constantly.

Metrics — the cheap numbers that alert you

A metric is just a number tracked over time: requests per second, error rate, p99 latency, memory used. They're aggregated — the system doesn't remember every individual request, just the running totals and distributions — which makes them tiny and cheap to store for years. That's why metrics power your dashboards and alerts: they're the smoke alarm that goes off the instant something trends the wrong way. Their weakness is that they tell you that the error rate jumped, never which requests or why.

Logs — the detailed story of one event

A log is a detailed record of a single thing that happened: 'request abc-123 to /checkout returned 500 because the payments call timed out.' Where a metric is an aggregate, a log is one specific event with all its context. Logs answer 'what exactly happened to this request?' The catch is volume and cost — logging everything at full scale is expensive, which is why structured logs (machine-readable key/value fields, not free-form text) matter: you can search and filter millions of them instead of grepping.

Traces — where the time went across services

A trace follows one request as it hops across many services and shows where the time and failures went — 'this request spent 800ms inside payments.' In a system split into twenty services, metrics and logs each only see their own corner; a trace is the only signal that stitches the whole journey into one timeline. That's covered in depth in Distributed tracing.

They're complementary, and the magic is using them together: a metric alerts you that error rate spiked, a trace shows you the failure happened in the payments hop, and a log from that exact span tells you it was a connection-pool timeout. A healthy system has all three — and crucially, a shared id so you can jump between them.

Emit a metric and a structured log for one request (python)
def handle(request):
    start = now_ms()
    resp = process(request)
    elapsed = now_ms() - start

    # Metric: cheap, aggregated — feeds p99 latency and error rate
    metrics.histogram("http.request.ms", elapsed,
                      tags={"route": request.route, "status": resp.status})

    # Structured log: one queryable event, with a trace id to join on
    log.info("request.handled", trace_id=request.trace_id,
             route=request.route, status=resp.status, ms=elapsed)
    return resp

The gap the three pillars can't fill

So now you can see the system. But seeing isn't the same as agreeing on whether what you see is good enough. Picture the dashboard lighting up: p99 latency is 220ms and 0.3% of requests are failing. Is that fine, or is it an emergency?

Without a pre-agreed target, that question has no answer — just opinions. The engineer who built the feature says it's fine; the product manager watching a few users complain says it's a crisis; nobody can prove either way. The pillars give you the numbers, but numbers with no target are just trivia. What's missing is a line in the sand: this number, at this level, is the definition of healthy. That line is what SLIs and SLOs give you.

SLIs, SLOs, and the error budget

Here's the idea that changes how teams argue about reliability. Instead of vague goals ('it should be reliable'), you define three precise things that build on each other:

  • SLI — the measurement. A specific number you actually compute from your metrics: 'the percentage of requests that return successfully in under 200ms.'
  • SLO — the target. The line you aim for: '99.9% of requests meet that bar, measured monthly.'
  • Error budget — the allowance. 100% minus the SLO. At 99.9%, you're allowed 0.1% failures — about 43 minutes a month.

The SLI itself is just a ratio you compute from the metrics you already collect — good events over total events:

Computing an SLI from raw request counts (python)
# An SLI is 'good events / valid events' over a window.
# Here: the fraction of requests that were both successful AND fast.
def availability_sli(window):
    good = count_requests(window,
                          status="2xx",        # didn't error
                          latency_under_ms=200) # and was fast enough
    total = count_requests(window)              # every valid request
    return good / total                         # e.g. 0.9993 -> 99.93%

sli = availability_sli(last_28_days)
meets_slo = sli >= 0.999       # SLO is the TARGET line (99.9%)
# The gap between `sli` and 1.0 is what you spent of your error budget.
The SLI is what you measured; the SLO is the target; the gap to 100% is your error budget.

Why the error budget is so useful

The budget reframes reliability as something you spend, not something you maximize blindly:

  • Budget left? Ship faster, take more risks, run experiments — you have room to fail.
  • Budget blown? Freeze risky releases and spend effort on stability until you're back under.
  • It ends the fight. Product wants features; reliability wants stability. The budget is the shared, objective referee — no more opinion-based arguments.
  • 100% is the wrong target. Chasing perfect uptime is ruinously expensive and blocks all change. The budget admits that some failure is acceptable and plans for it.
Burn-rate alert: are we spending the error budget too fast? (python)
SLO = 0.999                       # 99.9% of requests should succeed
ERROR_BUDGET = 1 - SLO            # 0.1% allowed to fail

def burn_rate(window):
    # fraction of requests failing right now, vs what we're allowed
    observed = window.errors / window.total
    return observed / ERROR_BUDGET

# Burning 14x over 1h means a month's budget gone in ~2 days -> page now.
if burn_rate(last_1h) > 14 and burn_rate(last_5m) > 14:
    alert("fast burn: freeze risky releases, investigate")

Choosing a good SLI — what to measure, what to skip

The quality of your whole reliability story comes down to picking SLIs that track real user pain. A quick guide to what earns its place:

For this kind of serviceA good SLIA tempting but weak SLI to avoid
Request/response API% of requests that are successful and under the latency target (p99)Average CPU or average latency — hides the painful tail
Data pipeline / batch job% of data processed and fresh within N minutes'The job ran' — it can run and still produce stale output
Storage / database% of reads and writes that succeed and are durableDisk usage — important, but not what the user feels
Streaming / long-lived connection% of time the stream stays connected and in syncTotal bytes served — volume isn't quality

The through-line: an SLI should answer 'did the user get what they came for, fast enough?' If a metric can be perfectly green while a user is suffering, it's the wrong SLI.

Observability is how you know your design actually works in the real world — and SLOs turn reliability from a feeling into a contract.

Why it matters

  • You can't operate, debug, or improve what you can't see — observability is the feedback loop for every other decision.
  • SLOs give engineering and product a shared, numeric definition of 'good enough'.
  • The error budget makes the speed-vs-stability trade-off explicit and self-regulating.

If ignored

  • Outages are discovered by angry users, not your dashboards, and take forever to diagnose.
  • Reliability debates become opinion wars with no objective referee.
  • Teams either chase impossible 100% uptime or ship recklessly — no shared guardrail.

Where it fits

  • A cross-cutting layer over every service — metrics, logs, and traces flowing to one place.
  • The governance layer of a design (recall TOGAF Phase G sets SLOs).
  • The feedback loop that tells you when to invoke resilience patterns like circuit breakers.

Related topics

Interview lens

Questions it unlocks

  • What's the difference between an SLI, an SLO, and an SLA?
  • What's an error budget and why is it useful?
  • How would you know your system is healthy in production?

60-second answer

Observability is understanding a system from the outside via three pillars — metrics for how much, logs for what happened, traces for where the time went. On top of that I'd define an SLI, an actual measurement like the percentage of requests under 200ms; an SLO, the target like 99.9%; and the error budget, which is 100% minus the SLO — the amount of failure we're allowed to spend. The budget is the key idea: with budget left we ship fast, when it's blown we freeze and fix, so it ends the speed-versus-stability argument with a number. I'd set SLIs on what users actually feel — success rate and p99 latency — not on convenient internal metrics.

Common traps

  • Setting SLOs on internal metrics (CPU) instead of user-facing experience.
  • Chasing 100% reliability instead of a sensible SLO with a budget.
  • Measuring average latency instead of p95/p99 and missing the painful tail.

Search topics

↑↓ to move · Enter to open · Esc to close