Reference · gazar.dev ← All cheat sheets

Reliability · observability

The observability & SLO cheat sheet.

S10 said it: reliability you can't measure is a wish. This sheet turns "it should be up" into numbers you can defend, alert on, and spend: SLIs, SLOs, SLAs and error budgets, the signals to watch (golden signals, RED, USE), the five pillars and OpenTelemetry, the tool landscape, multi-window burn-rate alerting, incident response and DORA. Companion to S10 · Observability & Operational Readiness.

01

Observability vs monitoring, and why it is a number

Monitoring is the dashboards you built for failures you predicted. Observability is being able to ask a question you never anticipated, from the data you already emit. Formally, it is how well you can infer a system's internal state from its outputs. Either way, reliability only becomes manageable once it is a number you agreed on in advance.

M

Monitoring

Pre-decided gauges for known failure modes: "is CPU over 80, is the queue backing up." Necessary, but it only answers questions you already thought to ask.

O

Observability

The ability to ask new questions of existing telemetry: "why are only Android users in one region seeing slow checkout?" You investigate without shipping new code.

The trap

Treating "we have dashboards" as observability. Dashboards answer the questions you anticipated. Real incidents are the ones you didn't, so the test is whether you can slice your telemetry by a dimension you didn't pre-build. And none of it matters until a number, the SLO, tells you whether things are actually fine.

02

What to measure: golden signals, RED & USE

Before SLIs, decide what is worth measuring at all. Three overlapping frameworks answer that. The golden signals are the idea; RED and USE are the recipes you apply per service and per resource.

FrameworkOriginThe signalsApply to
Golden signalsGoogle SRElatency, traffic, errors, saturationany user-facing system: the first four graphs to build
REDTom WilkieRate, Errors, Durationevery request-driven service; maps onto your SLIs
USEBrendan GreggUtilisation, Saturation, Errorsevery resource: CPU, memory, pool, disk, queue
REDper service / request
Rate
requests per second the service is handling.
Errors
the share of those requests that fail, explicit (500) and implicit (200 with a wrong body).
Duration
the latency distribution, watch p99 not the mean.
Use for
request-driven services; it maps almost directly onto your SLIs.
USEper resource
Utilisation
how busy the resource is (CPU, pool, disk).
Saturation
the queue or backlog waiting on it.
Errors
error events from the resource itself.
Use for
diagnosing the resource behind a slow service: CPUs, memory, pools, disks, NICs.

How they fit together

Golden signals are what to watch; RED tells you the service is hurting and how (alert on this, it is what the user feels); USE tells you which resource underneath is the cause (diagnose with this on a dashboard). Page on RED, investigate with USE.

03

SLI, SLO, SLA, error budget

Four linked ideas. Measure the signal (SLI), set your internal target (SLO), promise a looser one to customers (SLA), and the gap from your SLO to 100% is the budget you spend on risk and velocity.

TermIsAudienceIf missed
SLIa ratio of good events to total, that tracks user painengineersnothing, it is just the reading
SLOyour internal target on an SLI, over a windowthe teambudget burns, freeze rule kicks in
SLAa contractual promise to a customercustomers, legalcredits, refunds, penalties
Error budget1 minus the SLO; how much you may failthe teamunspent means you move too slowly

A worked SLO, written as one sentence

99.9% of checkout reads complete in under 200ms, over a rolling 28-day window.

   SLI    = reads under 200ms ÷ all reads          # the signal
   SLO    = 99.9% target on that SLI               # the internal promise
   SLA    = 99.5% in the customer contract         # looser, so the SLO warns first
   budget = 0.1% of reads may be slow ~ 43 min/mo  # the room to take risk

The one-line map

SLI is the thermometer, SLO is the temperature you promised yourself to hold, SLA is the temperature in the contract with a fine attached, and the error budget is how far you may drift before you stop adding features and fix reliability. Keep the SLO stricter than the SLA so you are warned before you owe refunds.

04

The error budget: minutes, burn rate & policy

Each nine you add to the SLO cuts the monthly allowance by ten. Knowing these by heart is the fastest way to sanity-check a target someone proposes in a review.

SLODowntime / monthDowntime / yearFeels like
99%~7h 18m~3.65 daysgenerous, internal tools
99.9%~43m~8.8htypical user-facing service
99.95%~21m~4.4himportant revenue path
99.99%~4m~52mexpensive, rarely needed
99.999%~26s~5mfive nines, very few systems
05

The pillars: metrics, logs, traces, profiling, events

The classic three (metrics, logs, traces) plus two now mainstream: continuous profiling and wide events. Each is best at one job. Reach for the wrong one and you either drown in cost or can't answer the question. Each card: answers the question it owns, use when to reach for it, watch the trap.

Metricswhat is happening
Answers
numbers over time: request rate, error count, p99 latency. Cheap to store and aggregate.
Use
the home of dashboards and SLOs; the first signal that something is wrong and by how much.
Watch
cardinality: tag with a high-variety field (user id, request id) and you explode into millions of series and a runaway bill.
Logswhy it happened
Answers
a timestamped record of one event with full context, the detail a metric throws away.
Use
root-cause once a trace points you at the failing hop. Emit structured (key-value), with a trace id, so you can query by field.
Watch
expensive at volume; unstructured prose you can't query; never log secrets or PII. Sample the chatty paths.
Traceswhere the time went
Answers
one request's journey across services as a tree of timed spans.
Use
when p99 is bad but no single service looks broken; the waterfall shows the slow hop.
Watch
needs context propagation (the W3C traceparent header); sample head or tail to control cost.
Profilinginside the process
Answers
where CPU and memory go inside one service, rendered as a flame graph (width = time on CPU).
Use
when a trace says one service is slow but there is no external cause. Pyroscope, Parca, language profilers.
Watch
sampling overhead if misconfigured; it explains a hot service, not a distributed problem.
Wide eventsslice by anything
Answers
one fat, high-cardinality record per unit of work (dozens of fields: tier, region, build, flags, timings).
Use
"observability 2.0": ask a question you never pre-aggregated for, slicing by any field after the fact.
Watch
storage and query engines must handle high cardinality (Honeycomb, columnar stores), not classic metrics DBs.

Metric types: pick the right shape

TypeIsExample
Countermonotonic total, query as a ratehttp_requests_total
Gaugea value now, up and downqueue_depth, mem_used
Histogrambucketed, aggregate percentiles server-siderequest_latency
Summaryclient-side quantiles, can't merge across podslegacy latency

Percentiles > averages, and how to sample

Averages lie. A mean of 120ms can hide a p99 of 900ms. On a page with 100 assets, a 1-in-100 slow request is almost every page. SLO and alert on p99 / p99.9, never the mean, because you are your p99 to your busiest users.

Sampling traces: head sampling decides at the first span (cheap, but throws away rare errors); tail sampling buffers the whole trace and keeps it if it erred or was slow (needs a collector, catches the interesting ones).

The investigation path: metric to trace to log to profile

flowchart TB
  A["alert fires: p99 checkout up"] --> M["METRICS: what and how bad, the SLO is burning"]
  M --> T["TRACES: which hop is slow, payments span 540ms"]
  T --> L["LOGS: why that hop failed, timeout calling provider"]
  L --> P["PROFILE: why it is slow inside, a hot serialize loop"]
  P --> R["root cause"]
  classDef good fill:#D6F5E3,stroke:#1B7F46,color:#09244B
  class R good
06

OpenTelemetry: instrument once, send anywhere

OTel is the CNCF standard (a merge of OpenTracing and OpenCensus) for generating traces, metrics and logs. Instrument with vendor-neutral SDKs and auto-instrumentation, ship over the OTLP protocol to a Collector, and the Collector fans out to any backend. The payoff: your instrumentation no longer marries you to one vendor.

flowchart LR
  APP["your app: OTel SDK plus auto-instrument"] -->|OTLP| COL["OTel Collector: receive, batch, sample, redact"]
  COL --> PROM["Prometheus or Mimir: metrics"]
  COL --> TEMPO["Tempo or Jaeger: traces"]
  COL --> LOKI["Loki or ELK: logs"]
  COL --> SAAS["Datadog or Honeycomb: if you prefer SaaS"]
  classDef hub fill:#DCEBFE,stroke:#4A90D9,color:#09244B
  classDef out fill:#D6F5E3,stroke:#1B7F46,color:#09244B
  class COL hub
  class PROM,TEMPO,LOKI,SAAS out

Why it won

OTel is a universal plug. Wire your app to the plug once; swap the wall socket (backend vendor) whenever you like without rewiring the house. The Collector is also where you control cost centrally: batch, tail-sample, drop high-cardinality labels, and redact PII before data hits an expensive backend.

07

The tool landscape & three sane stacks

You do not need all of it, one thing per job. The landscape splits into open-source components you run and SaaS you pay for, tied together by OpenTelemetry.

JobOpen-sourceSaaS / hosted
Instrument & collectOpenTelemetry, Fluent Bit, Vector, eBPF (Pixie)vendor agents (Datadog Agent)
MetricsPrometheus, VictoriaMetrics, Mimir / Thanos / CortexDatadog, Chronosphere
DashboardsGrafanaDatadog, New Relic, Kibana
LogsLoki, Elasticsearch / OpenSearchSplunk, Datadog, Sumo Logic
TracesJaeger, Tempo, ZipkinDatadog APM, Honeycomb, Lightstep
ProfilingPyroscope, ParcaDatadog, Polar Signals
ErrorsGlitchTipSentry, Rollbar, Bugsnag
Alerting & on-callAlertmanager, Grafana OnCallPagerDuty, Opsgenie
StackWhatWins whenWatch out
OSS "LGTM"Prometheus + Grafana + Loki + Tempo + Alertmanager, fed by OTelcost-sensitive, own your data, k8s-nativeyou run it: storage, upgrades, on-call for the tooling
SaaS all-in-oneDatadog, New Relic, Honeycombsmall team, want it working today, correlation built-incost scales with hosts + cardinality; bill shock
Cloud-nativeCloudWatch, Google Cloud Ops, Azure Monitorsingle-cloud, basics only, zero extra vendorsweaker tracing/UX, poor cross-cloud, lock-in

The decision rule

Self-host (OSS) to save money and own the data if you have hands to run it. Pay a SaaS to skip the plumbing if you have budget not time. Use the cloud's built-in if you are small and single-cloud. All three are defensible; hand-rolling twelve disconnected tools is not.

08

Alerting on pain, not noise

High CPU is not an incident; a user who can't check out is. Page on the symptom and on budget burn; leave causes on dashboards. Every page should mean "a human is hurting right now," or people learn to ignore the pager.

flowchart TB
  subgraph PAGE["page on a symptom or burn"]
    P1["SLO error budget burning fast"]
    P2["checkout success rate dropping"]
    P3["p99 latency over the SLO"]
  end
  subgraph DASH["keep on a dashboard"]
    D1["CPU at 95 percent"]
    D2["memory at 70 percent"]
    D3["queue depth rising slowly"]
    D4["cache hit ratio"]
  end
  RT["rule of thumb: if users do not feel it yet, it is not a page"]
  P3 ~~~ D1
  D4 ~~~ RT
  classDef bad fill:#FEE4E2,stroke:#C8102E,color:#09244B
  classDef accent fill:#DCEBFE,stroke:#4A90D9,color:#09244B
  class P1,P2,P3 bad
  class RT accent

Multi-window burn-rate alerts (the SRE standard)

Budget spentLong windowShort windowBurn rateResponse
2% in 1h1 hour5 min14.4×page immediately
5% in 6h6 hours30 minpage
10% in 3d3 days6 hoursticket, fix in hours
09

Incident response & the "mean time to" family

An incident is a process, not a scramble. Classify severity, assign clear roles, mitigate before you root-cause, and learn blamelessly. Then measure how you did with the MTTx metrics.

flowchart LR
  DET["Detect: alert fires"] --> TRI["Triage: set SEV, assign an incident commander"]
  TRI --> MIT["Mitigate: stop the bleeding, rollback or shed load"]
  MIT --> RES["Resolve: fix the root cause"]
  RES --> LRN["Learn: blameless postmortem, action items"]
  classDef good fill:#D6F5E3,stroke:#1B7F46,color:#09244B
  class LRN good

The MTTx family: know which clock you mean

MetricClock startsClock stops
MTTD detectfailure beginsyou know about it
MTTA acknowledgealert firesa human owns it
MTTR restorefailure beginsusers served again
MTBF betweenservice recoversit breaks again

MTTR is ambiguous, and availability falls out of it

MTTR can mean restore (service back, what most teams track) or repair / resolve (root cause fixed). Pin the definition before you set a target, or two teams report the same incident very differently.

availability = MTBF ÷ (MTBF + MTTR)
            = uptime ÷ total time

Shrinking MTTD and MTTR buys nines without making the system fail less often. Fast recovery beats rare failure, and it is usually cheaper to build.

Blameless postmortems

Ask "what let this happen and slip through," not "who did it." People hide mistakes from blame and surface them for fixes. Severity (SEV1/2/3) sizes the response; the incident commander coordinates so no one is both firefighting and updating the status page.

10

DORA & delivery metrics

Zoom out from one service to the whole delivery system. Google's DORA research (the State of DevOps reports, and the book Accelerate) found four metrics that predict performance, split across two axes: throughput (speed) and stability. The headline: elite teams are fast and stable. Speed and safety are not a trade-off.

MetricAxisMeasuresElite benchmark
Deployment frequencythroughputhow often you ship to prodon-demand, many/day
Lead time for changesthroughputcommit to running in produnder a day
Change failure ratestability% of deploys causing a failure0–5%
Failed-deploy recoverystabilitytime to recover a bad deployunder an hour
11

Operational readiness checklist

Correct code is necessary, not sufficient. Before a service carries real traffic it needs the means to be seen, alerted on, and recovered. Steal this list for the capstone.

Before launch, you have

  • Dashboards, the golden signals on one screen, RED for the service.
  • SLOs defined, with error budgets and a burn-rate alert.
  • Alerts, symptom-based, each tied to user pain.
  • Runbook, what to do when each alert fires.
  • On-call, a named rotation and an escalation path.
  • Rollback, a tested way back, not just forward.
  • Degradation mode, a known way to shed load (ties to S9).
  • Health checks, liveness + readiness the platform can probe.
  • Trace context, correlation ids propagate end to end.

The mindset

"Done" includes operability. A feature that works in the happy path but can't be observed, alerted on, or rolled back is not ready, it is a future incident with no instrumentation.

The readiness review is where a senior engineer earns trust: not "does it work" but "when it breaks at 3am, can the on-call see it, understand it, and recover, without you?"

12

Telemetry cost: the part that surprises people

At scale, observability bills rival infra bills. Control the three cost drivers deliberately, at the Collector, before data hits the expensive backend, or finance controls them for you by turning things off.

Cardinality

Drop high-variety labels. The user-id tag is the classic five-figure bill-killer. Keep metric labels low-cardinality; push high-cardinality detail into wide events or logs.

Sampling

Tail-sample traces: keep errors and slow requests, drop the boring 99%. Sample chatty logs. You rarely need every successful request stored forever.

Retention tiers

Hot storage for 7 days, cold or archive after; aggregate old metrics down to lower resolution. Decide what is worth keeping, and for how long.

13

Question → pillar / tool

Start from the question you are actually asking and reach for the telemetry that answers it.

flowchart TB
  Q{"what are you trying to answer?"}
  Q --> A1["is the service healthy right now?"] --> R1["METRICS RED plus the SLO"]
  Q --> A2["how much budget have we burned?"] --> R2["error budget plus burn rate"]
  Q --> A3["which hop made this request slow?"] --> R3["TRACES, spans"]
  Q --> A4["why did that specific call fail?"] --> R4["LOGS, structured by field"]
  Q --> A5["why is one service slow with no external cause?"] --> R5["PROFILE, flame graph"]
  Q --> A6["which resource is the bottleneck?"] --> R6["METRICS USE"]
  Q --> A7["what did the slow requests have in common?"] --> R7["WIDE EVENTS, slice by field"]
  classDef accent fill:#DCEBFE,stroke:#4A90D9,color:#09244B
  class Q accent
You want to…Reach forNot
Know if users are in painSLI / SLO (RED)raw CPU graphs
Decide whether to freeze featuresError budget + policygut feel
Find the slow service in a requestTracesgrepping logs blindly
Explain one failure in detailStructured logsa metric counter
Speed up one hot serviceContinuous profilinga distributed trace
Diagnose a saturated resourceUSE metricsa trace
Slice an incident by any dimensionWide eventspre-aggregated metrics
Decide what to page onSymptom / burn ratecause thresholds
14

Interview questions, with crisp answers

The observability questions that come up, and the sentence or two that shows you understand the trade-off rather than reciting a term.

Q · SLI vs SLO vs SLA vs error budget?

SLI is the measured signal (good ÷ total). SLO is your internal target on it. SLA is the looser customer contract with penalties. The error budget is 1 minus the SLO. Keep the SLO stricter than the SLA so you are warned before refunds.

Q · Golden signals vs RED vs USE?

Golden signals (latency, traffic, errors, saturation) are the idea. RED (rate, errors, duration) applies it per service; USE (utilisation, saturation, errors) applies it per resource. Alert on RED, diagnose with USE.

Q · Why is 100% the wrong SLO?

It leaves zero error budget, so it forbids all risk, all deploys, all velocity, and you still can't hit it because dependencies fail. Pick the lowest number users won't notice.

Q · Metrics, logs, traces or profiles, for what?

Metrics for what and how bad (cheap, SLOs). Traces for where the time went across services. Logs for why one call failed. Profiles for why one service is slow inside. Walk them in that order.

Q · What is OpenTelemetry?

The CNCF standard for emitting traces, metrics and logs. You instrument once with vendor-neutral SDKs, ship OTLP to a Collector, and fan out to any backend, so instrumentation no longer locks you to one vendor.

Q · Head vs tail sampling?

Head decides at the first span (cheap, but discards rare errors before you know they mattered). Tail buffers the whole trace and keeps it if it erred or was slow (needs a collector, catches the interesting ones).

Q · What is a burn-rate alert?

An alert on how fast you are spending the error budget, not a static threshold. Multi-window (short confirms now, long confirms real): fast burn pages, slow burn tickets. It catches both the spike and the slow leak.

Q · Why not alert on CPU?

CPU is a cause, not a symptom; high CPU with happy users is fine. Page on what users feel (the SLO burning), keep CPU on a dashboard for diagnosis. It is how you avoid alert fatigue.

Q · What does MTTR actually mean?

It is ambiguous: restore (service back) or repair (root cause fixed). Say which. Availability = MTBF ÷ (MTBF + MTTR), so cutting detection and recovery time buys nines without reducing how often you break.

Q · What are the DORA metrics?

Four delivery metrics on two axes: deployment frequency and lead time (speed), change failure rate and recovery time (stability). The finding: elite teams are fast and stable. A fifth, reliability, ties to your SLOs.

Q · What breaks a metrics system?

Cardinality. Tagging a metric with a high-variety label (user id, request id) multiplies it into millions of series, blowing up cost and query time. Keep labels low-cardinality; use wide events for the detail.

Q · Counter vs histogram?

A counter only climbs; you read it as a rate. A histogram buckets observations so you can aggregate percentiles across instances, which a client-side summary can't. Use histograms for latency SLIs.

15

Traps & the repeatable move

The ways observability goes wrong, and the habit that catches all of them.

The traps

  • Vanity metrics, busy graphs nobody acts on.
  • 100% SLOs, zero budget forbids all risk and velocity.
  • Alerting on causes, paging on CPU breeds fatigue.
  • Averages instead of percentiles, the mean hides the p99 pain.
  • Unstructured logs, prose you can't query when it matters.
  • High-cardinality metric labels, a runaway cost blowup.
  • Head-sampling that drops every error, blind in the incident.
  • No error-budget policy, the budget has no teeth.
  • No runbook, the alert fires and everyone improvises.
  • Dashboards no one opens in an incident, built once, never used.

The repeatable move

1. pick the signals users feel (golden / RED)
2. set an SLI + SLO + error budget on them
3. instrument the pillars once via OpenTelemetry
4. alert on the symptom / burn, not the cause
5. run incidents blamelessly, measure MTTR

The tell in a design review: an alert on a cause (CPU, memory) with no SLO behind it, or a metric tagged with something high-cardinality. Spot it and push back.

Companion to S10 · Observability & Operational Readiness. Further reading: Google SRE · Service Level Objectives · SRE Workbook · Alerting on SLOs · The RED method · Brendan Gregg · The USE method · OpenTelemetry · Observability primer · DORA · software delivery metrics.