It's 2 a.m. and checkout is slow. Not down, just slow enough that the support channel is filling up. Back when the app was one process on one box, you'd open the log, find the stack trace and go back to bed. Now one checkout touches a gateway, an auth service, orders, payments and a database, each with its own logs on its own machines. Every team looks at its own dashboard and says "looks fine on our side."
This post is about getting out of that spot. If you're still deciding what to instrument in a new system, start with Observability as a Design Choice. Here we're past that: the system is already big, and the questions are how to follow one request across services, which numbers to watch, when to wake someone up and how to keep the bill sane.
A quick word on terms. Monitoring watches for failures you predicted: CPU high, disk full, error rate up. Observability, as the OpenTelemetry primer puts it, lets you understand a system from the outside by asking it questions, and a system counts as well instrumented when you don't need to add more instrumentation to troubleshoot an issue. At scale you need both. Monitoring tells you something broke. Observability helps you find out why without shipping a new build at 2 a.m.
Metrics, logs and traces each have one job
Teams get into trouble when they ask one kind of data to do another's job: grepping logs to count errors per minute, or building yet another dashboard to find which service added the latency.
- Metrics are numbers over time: request count, error count, p99 latency, queue depth. They're cheap because they're aggregated, which makes them right for dashboards and alerts. They can't tell you which request or which user. A metric is the smoke alarm, and it won't tell you which room.
- Logs are individual events with detail: "order 8123 failed validation: missing shipping address." They answer "what happened in this exact case?" At volume they get expensive to store and search, and a free-text log line across fifty machines is close to unsearchable. Write them as structured fields.
- Traces follow one request across services as a tree of timed spans. The idea goes back to Google's Dapper paper (2010), and OpenTelemetry describes a trace today as the record of "the path taken by a single request." Traces answer "which hop was slow?" and "which hop failed?"
// Free text: readable on one machine, painful to query across fifty
console.error(`Order ${orderId} failed for ${userId}: ${err.message}`)
// Structured, and stamped with the current trace ID
import { trace } from '@opentelemetry/api'
const traceId = trace.getActiveSpan()?.spanContext().traceId
logger.error({
event: 'order_failed',
trace_id: traceId,
order_id: orderId,
user_id: userId,
error: err.message,
})
One trace ID, passed along every hop
If you only do one thing from this post, do this. Create a trace ID when a request enters your system, pass it to every service the request touches and put it on every log line and span. OpenTelemetry calls this context propagation. Once it works, "what happened to this checkout?" is one search instead of a group chat across five teams.
You don't need to invent a header for it. The W3C Trace Context Recommendation defines a traceparent HTTP header with a version, a 32-hex-character trace ID, the parent span ID and flags:
traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01
OpenTelemetry SDKs read and write that header for you, and they send metrics, logs and traces in one vendor-neutral format, so you can switch backends without re-instrumenting everything. Adopt it while you have five services. Adding propagation across fifty services that each built their own logging is slow, boring work that nobody gets to prioritize.
Reading a trace waterfall
A trace viewer draws every span of one request on a shared timeline. Parent spans sit on top, children are indented below. Wide bars are where the time went, and gaps between bars are time nobody instrumented. In the example below the request takes about 320 ms, and payment-service alone takes 200 ms of it. "Checkout is slow" becomes "payment is slow" in the time it takes to open the trace, and the payments team gets a link instead of a vague ping.
Metrics that scale: RED, USE and the cardinality trap
You don't need hundreds of dashboards. Two well-known recipes cover most of what matters:
- RED, from Tom Wilkie, for request-driven services: Rate (requests per second), Errors (how many fail) and Duration (the latency distribution). It's close to the four golden signals in Google's SRE book: latency, traffic, errors and saturation.
- USE, from Brendan Gregg, for resources like CPU, disks and connection pools: "For every resource, check utilization, saturation, and errors."
Wilkie's own framing is handy: RED shows what users feel, USE shows how the machines are doing.
Then there's cardinality, the trap that blows up metrics bills. The Prometheus docs say it directly: every unique combination of label values is a new time series, so don't use labels for things like user IDs, email addresses or "other unbounded sets of values." Keep metric labels to small, fixed sets: status code, route template, region. Questions about one specific user or request belong in traces and logs.
Say someone adds user_id as a label on http_requests_total to debug one customer. With a million active users, that one metric can turn into a million series per route and status code. Use the route template (/orders/:id), never the raw URL, and send per-user questions to traces.
From "is it up?" to "is it good enough?"
A big step for any team is measuring what users experience instead of how busy the machines are, and putting a number on it. The SRE book's SLO chapter lays out the vocabulary:
- An SLI (service level indicator) is a measurement of the service, usually a ratio of good events: the share of checkout requests that succeed in under 300 ms, for example.
- An SLO (service level objective) is the target for that SLI: 99.9% over a rolling 30 days.
- The error budget is what's left: 100% minus 99.9% is 0.1%. Over 30 days, that's about 43 minutes of full outage, or the same share of requests failing or running slow across the month.
The budget gives product and engineering one number to argue about instead of two opinions. Plenty of budget left? Ship, run the experiment, take the risky migration. Budget nearly gone? Spend the next sprint on reliability. The same number also tells on-call which problems are worth a page.
Alerts that wake you for the right reasons
The fastest way to wreck on-call is to page on causes. "Disk at 80%" fires at 3 a.m. every night for a volume that grows on its own, and within a month nobody reads that channel, including the night the real alert lands there.
Google's monitoring chapter splits it into "what's broken" (the symptom) and "why" (the cause), and sets a strict bar for pages: every page should be actionable, and if a page only needs a robotic response, it shouldn't be a page. In practice, page on symptoms users feel (errors, latency past the SLO) and send cause-level signals to dashboards and tickets.
The SRE workbook turns this into burn-rate alerts. Burn rate is how fast you use the error budget relative to the SLO. A burn rate of 14.4 sustained for one hour uses 2% of a 30-day budget, so that's worth a page. The workbook pairs the long window with a short one so the alert also stops quickly once the problem is fixed:
# Prometheus rule for a 99.9% SLO. The two ratio series come from
# recording rules, as in the SRE workbook example.
groups:
- name: checkout-slo
rules:
- alert: CheckoutErrorBudgetFastBurn
expr: |
job:slo_errors_per_request:ratio_rate1h{job="checkout"} > (14.4 * 0.001)
and
job:slo_errors_per_request:ratio_rate5m{job="checkout"} > (14.4 * 0.001)
labels:
severity: page
annotations:
summary: "Checkout is burning its 30-day error budget 14.4x too fast"
runbook_url: "https://wiki.example.com/runbooks/checkout-errors"
The workbook adds a second page at burn rate 6 over six hours (5% of the budget) and a ticket at burn rate 1 over three days (10%). Whatever thresholds you pick, link a runbook from every page, so whoever wakes up has a first step to take.
The bill is real: sampling and retention
Telemetry can end up costing a surprising amount next to the service it watches, mostly because of traces and logs. Three settings keep it in check:
- Sampling. Head sampling decides at the start of a request, which is cheap but blind to how the request ends. Tail sampling decides after looking at most of the spans, so you can always keep traces with errors or high latency and keep only a small share of the healthy ones. The OpenTelemetry sampling guide is honest about the cost: tail sampling is harder to set up and run, because it needs stateful components to hold spans until the decision.
- Retention tiers. Keep recent data hot and searchable for days, and move older data to cheaper storage for months, or drop it.
- Cardinality rules. Decide which labels are allowed on metrics and review new ones like you'd review a schema change.
Make these choices on purpose. If you don't, the invoice makes them for you, usually right after the busiest week of the year.
Which data answers which question
| The question you're asking | Where to look |
|---|---|
| Is something wrong right now? | Metrics, plus burn-rate alerts on your SLOs |
| Which service is adding the latency? | Distributed traces (the waterfall) |
| What happened to this one request? | Structured logs, found by trace ID |
| Can we ship this week, or fix reliability first? | SLO and the error budget left |
| Why did a whole class of errors start at 14:02? | All three, joined by trace ID and the deploy log |
What fits at each size
- Small team, one or two services: you don't need a platform. An error tracker, structured logs you can search and a couple of uptime and latency alerts cover most incidents. Do one cheap thing now: put a trace ID on every log line. It costs almost nothing today and pays off the day a second service shows up.
- Growing company, a handful of teams: adopt OpenTelemetry before each team picks its own tooling, and make sure trace context crosses every hop, including queues. If services talk through events and sagas, as in Who Owns the Data?, the trace context has to travel in the message headers too, or the trace stops at the first queue. Add RED metrics per service, write SLOs for the one or two journeys that pay the bills, like login and checkout, and delete any alert nobody acted on last month. Start sampling before the bill forces it.
- Large organization: telemetry is a platform with an owning team. Each product team owns its SLOs and its on-call. Error-budget policy can gate releases. Sampling, retention and label rules are set centrally because the cost is a real budget line. At this size, collecting data is the easy part. The hard part is acting on the budget, keeping alerts honest and writing runbooks before the incident.
Try this week
- Pick one request path and check that the same trace ID shows up in the logs of every service it touches. Fix the first hop where it disappears.
- List your metric labels and look for anything unbounded: user IDs, raw URLs, emails.
- Write one SLO for your most important user journey and work out its monthly error budget in minutes.
- Go through last month's pages. For each one, ask whether someone had to think to resolve it. If not, turn it into a ticket or delete it.
- Add a runbook link to every alert that can page someone.
Observability pairs with resilience. Resilience keeps the system standing when parts fail. Observability tells you which part failed and why, ideally before your users notice. Between them, a 2 a.m. incident turns into something you can actually work through.