← Building blocks

Set SLOs and spend the error budget

Observability & operationssenior

Teams argue about whether the system is reliable enough and whether to ship or stabilise.

Say it like this

I set an SLO for what users feel, say 99.9% of redirects succeed within 300 ms over 30 days, treat the 0.1% as a budget the team can spend on launches, and page on how fast that budget is burning rather than on single blips.

Basic solution

Define an SLO (99.9% of requests succeed within 300 ms over 30 days). The allowed failures are the error budget; alert when it burns too fast, and pause risky launches when it is spent.

SLIs / SLOsburn-rate alertserror budget policy

Budget, burn rate and the two alert windows

The SLI feeds a budget counter. A fast burn over the last hour pages; a slow burn over six hours tickets. Exhaustion triggers the launch freeze in the policy.

How it works

  1. Pick a service level indicator (SLI) that users feel, and express it as a ratio of good events to total events. For a redirect service, a good event is a request that returned a 3xx within 300 ms; the SLI is good redirects divided by all redirects.
  2. Choose a target and a window: 99.9% over a rolling 30 days. That target is the service level objective (SLO). The remainder, 0.1%, is the error budget: the share of requests you are allowed to get wrong before the promise is broken.
  3. Turn the budget into a count you can track. At 10M requests per day the window holds 300M requests, so 0.1% means 300K failed or slow requests are allowed before the budget is spent.
  4. Measure burn rate, which is how fast the budget is being consumed relative to the pace that would use it up exactly at the end of the window. A burn rate of 1 means you will run out on day 30; a burn rate of 14.4 means you will run out in about 2 days, so something is badly wrong right now.
  5. Alert on burn rate using two windows at once. A fast burn (14.4× measured over the last hour, confirmed over the last 5 minutes so a resolved blip does not page) wakes the on-call. A slow burn (6× over 6 hours, or 1× over 3 days) opens a ticket, because it signals a leak that will matter by month end.
  6. Apply an error budget policy, agreed in advance. While budget remains, the team ships features and runs risky migrations. When it is exhausted, non-essential launches freeze and the time goes to reliability until the rolling window has recovered enough budget.

Why a budget rather than a target

  • A target is a line people argue about after the fact. A budget is a quantity you can spend, watch and run out of, which turns reliability into a decision the team makes together before a launch rather than a blame exercise after an incident.

Worked example

URL shortener redirect SLO

  • Traffic: 4,000 redirects/s average ≈ 346M per day ≈ 10.4B per 30 days.
  • SLO: 99.95% of redirects return a 3xx within 300 ms. Budget: 0.05% × 10.4B ≈ 5.2M bad requests per window, about 173K per day.
  • Fast-burn alert: 14.4× burn means 14.4 × 173K ≈ 2.5M bad requests in a day, or 29 per second sustained. Over a 1-hour window that is 104K bad requests; at 4,000/s that is an error ratio of 0.72%. Page when the 1-hour error ratio exceeds 0.72% and the last 5 minutes also exceed it.
  • Slow-burn ticket: 6× over 6 hours is an error ratio of 0.3%. A deploy that adds 0.3% timeouts gets noticed within hours, not at the end of the month.
  • A 20-minute full outage: 20 × 60 × 4,000 = 4.8M failed redirects, 92% of the monthly budget gone in one incident. The policy then freezes risky launches until the window rolls forward enough to restore budget.
  • Availability maths for the interviewer: 99.9% allows 43 minutes of full outage per 30 days; 99.95% allows 22 minutes; 99.99% allows 4.3 minutes, which is less than one human-driven incident response.

Variants and when each wins

Request-based SLI

  • Good requests divided by total requests, so the SLI is weighted by traffic. It wins for APIs because it matches what users experience, with the side effect that an outage in a quiet hour costs little budget.

Time-based SLI (availability windows)

  • The fraction of minutes in the window during which the service was healthy. It wins when customers describe uptime in minutes of outage, because it treats a quiet-hour outage the same as a peak one.

Multi-threshold latency SLO

  • Two targets at once, such as 99% of requests under 300 ms and 99.9% under 1 s. It wins when both the typical experience and the slow tail matter, because a single threshold hides one of them.

Composite user-journey SLO

  • Measured at the client or the gateway across several services, such as "a user can post and see it in their feed within 5 s". It wins when the product promise spans services; it is harder to attribute a breach to one team.

Recommendation: start with one request-based SLI per user-facing endpoint class, add a latency threshold, and only build journey SLOs once per-service ones are trusted.

Failure modes

Target set at 100%

  • Every incident becomes a crisis and nobody can ship anything. It happens because a 100% target leaves no budget, so any failure is a breach. Pick the target from measured history and what users actually tolerate, usually two or three nines for a side project and up to four for a payment path.

Internal SLI nobody feels

  • The SLO dashboard is green during a user-visible outage. It happens because the SLI measures CPU or a health endpoint instead of real requests. Measure at the edge or in the client, and count a 200 response with an empty body as a bad event.

Single-window alerts

  • The pager fires on a 2-minute blip, or stays silent during a slow leak that eats the budget over a week. It happens because one threshold over one window cannot tell a spike from a trend. Use multi-window, multi-burn-rate alerts: a fast burn pages and a slow burn tickets.

Budget with no policy

  • The budget is exhausted and launches continue anyway. It happens because nobody agreed what exhaustion means before it happened. Write the policy before the first breach, with the launch freeze and the exception path signed off by product.

Dependencies you cannot control

  • A third-party SMS provider has a bad day and consumes the whole budget. It happens because the SLO counts their failures as yours. Keep separate SLIs for your path and theirs, add a failover provider, and publish an SLO that reflects the dependency.

Interviewer follow-ups

Answer out loud before you open each one.

Why alert on burn rate instead of on the error ratio?

Burn rate normalises the error ratio against the budget and the window, so the same alert expresses "we will run out in two days" regardless of traffic. It also lets you page on fast burns while only ticketing slow ones, which an error-ratio threshold cannot distinguish.

How do you choose the SLO number?

From three inputs: what users actually tolerate, what the system achieved over the last quarter, and what the dependencies allow. Setting it slightly below current performance gives a usable budget; setting it above what dependencies can deliver guarantees permanent breach.

What happens when two teams share one budget?

Attribute bad events by the service that failed using traces or error sources, and give each team its own SLO for its slice with the composite SLO owned by the product. Without attribution the budget becomes a blame argument instead of a decision tool.

How does an error budget interact with deploys?

Deploy frequency is the main thing the budget buys: with budget left, canaries can be aggressive and migrations can run in the day; with budget spent, changes are limited to fixes until the window recovers. That rule is what makes the budget a real constraint rather than a dashboard.

Connections

In study paths
Knowing what broke
Pairs with
Measure what users feel · Measure p95 / p99, not the average · Deploy without downtime · Ship dark, release gradually · Degrade instead of failing

The same parts on other clouds

The diagrams above name AWS services as one concrete example. Every part has a close equivalent elsewhere. In an interview, name the role first, such as “a managed Redis cache”, then the product you would pick.

AWSUsed here asGoogle CloudMicrosoft AzureOpen source and others
Amazon CloudWatchSLI stream, Fast burn 14.4×, Slow burn 6×Cloud Monitoring, Cloud LoggingAzure MonitorPrometheus and Grafana, Datadog