SLOs, error budgets and alerting
SLIs, SLOs and error budgets with the arithmetic (nines in minutes, dependencies in series), burn-rate alerts with several windows tested on a simulated bad month, then pages, incidents and the ways alerts fail.
ConceptCore27 min readUpdated
- 4 code samples
- 5 interviewer follow-ups
- 5 self-checks
On this page9 sectionsHLDLLDSenior depth
Read first: Latency, throughput and queues, Observability: metrics, logs and traces
- Define SLIs, SLOs, SLAs and an error budget, and turn a target into minutes of allowed failure.
- Compute the availability of dependencies in series and in parallel.
- Explain a multi-window, multi-burn-rate alert, and why each window and threshold is there.
- Say what each alert rule catches and misses, using the simulated month.
- Run an incident in the right order, and keep pages worth their interruption.
4 code samples (207 lines), collapsed so the explanation stays in focus.
"Is it up?" is the wrong question for a system with millions of users. Part of it is always down and some requests are always failing, so the useful questions are how much, for whom, and whether that is acceptable. A service level objective answers with a number, the error budget turns the number into something a team can spend, and burn-rate alerts tell a human when it is being spent too fast. This is the machinery behind most on-call rotations at large companies, and a senior interview expects the arithmetic to be done aloud.
The previous lesson covered the signals. This one turns them into a promise and an alert, tests the alert rules on a simulated month, and covers what happens after the page: dashboards, on-call, incidents, and the ways alerts fail.
A service level indicator (SLI) measures how well the service is doing, usually as good events over valid events: the share of requests that succeeded and were fast enough. A service level objective (SLO) is a target for it over a window: 99.9% of requests succeed in under 300 ms over 30 days. A service level agreement (SLA) is a contract with consequences such as credits, and it is looser than the internal SLO, so that trouble is noticed before money is owed. The error budget is what the SLO leaves: the unreliability the service is allowed to spend.
| SLO | Budget | Allowed badness in 30 days |
|---|---|---|
| 99% | 1% | 7.2 hours |
| 99.9% | 0.1% | 43.2 minutes |
| 99.95% | 0.05% | 21.6 minutes |
| 99.99% | 0.01% | 4.3 minutes |
| 99.999% | 0.001% | 26 seconds |
- The budget is for spending. Deploys, experiments, migrations and incidents all draw on it. When it runs out, risky launches stop and effort goes to reliability, as an error budget policy agreed in advance says. That turns an argument between product and operations into arithmetic. A budget that is never touched means the service is more reliable than anyone asked for, and shipping faster would be the better trade.
- 100% is the wrong target. It cannot be met, every extra nine costs far more than the last, and users' own devices and networks fail more often than that anyway.
- Dependencies erode it. A request that needs three services in series, each 99.9% available, succeeds 99.7% of the time (availabilities multiply), and ten such dependencies give about 99.0%. A service cannot beat the product of its hard dependencies unless it adds redundancy (two independent copies in parallel, each 99.9%, give 99.9999%) or degrades gracefully when one fails, for example by serving stale data. Independence is the catch: copies in one zone fail together.
- Choose the SLI as the user feels it. A response that is too slow is a bad event. A request-based SLI (good requests over all requests) is fairer than a time-based one (minutes that were fine) when traffic is uneven, because a bad minute at 3 a.m. and a bad minute at noon are not equal.
- Decide what is valid. Requests that fail because of the client (a 404 for a page that does not exist, a malformed body) are usually left out or counted as good, since the service did its job. Timeouts, 5xx responses, wrong answers and requests your own load shedding refused are bad events, because the user does not care why.
- Set it from data and from need. Measure what the service achieves for a month or two before promising it, ask what users notice, leave room for the dependencies, and set different objectives for different journeys (checkout needs more nines than a recommendations widget). Tightening an SLO later is easy. Loosening a published one is not.
C# · The downtime an availability target allows in 30 days, in minutes. The error budget is…
using System;
using System.Diagnostics;
// The downtime an availability target allows in 30 days, in minutes. The error budget is what the target leaves.
double BudgetMinutes(double slo) => (1 - slo) * 30 * 24 * 60;
Debug.Assert(Math.Abs(BudgetMinutes(0.99) - 432) < 1e-6); // 7.2 hours
Debug.Assert(Math.Abs(BudgetMinutes(0.999) - 43.2) < 1e-6);
Debug.Assert(Math.Abs(BudgetMinutes(0.9995) - 21.6) < 1e-6);
Debug.Assert(Math.Abs(BudgetMinutes(0.9999) - 4.32) < 1e-6);
Debug.Assert(Math.Abs(BudgetMinutes(0.99999) * 60 - 25.92) < 1e-6); // about 26 seconds
// A request that needs several services in series succeeds only when all of them are up, so their availabilities multiply.
double InSeries(double availability, int services) => Math.Pow(availability, services);
Debug.Assert(Math.Abs(InSeries(0.999, 3) - 0.997003) < 1e-9); // three 99.9% services: 99.7%
Debug.Assert(InSeries(0.999, 10) > 0.989 && InSeries(0.999, 10) < 0.991); // ten of them: about 99.0%
// Redundant copies in parallel fail only when all of them fail, if they fail independently.
double InParallel(double availability, int copies) => 1 - Math.Pow(1 - availability, copies);
Debug.Assert(Math.Abs(InParallel(0.999, 2) - 0.999999) < 1e-12);What to measure depends on what the service is. The pattern is always good events over valid events, measured close to the user.
| What you run | Useful SLIs |
|---|---|
| A request and response service | Availability: responses that are neither errors nor timeouts. Latency: responses faster than a threshold such as 300 ms. Often both, over the same requests |
| A pipeline or a search index | Freshness: records visible within five minutes of arrival. Correctness or completeness: records processed correctly over records received |
| A queue consumer | Lag: messages handled within a bound of being published, or the age of the oldest unprocessed message |
| Storage | Availability of reads and writes. Durability: the share of objects not lost, a bar so high that it is modelled and not measured (see erasure coding and durability) |
| A batch job | Timeliness: runs finished before their deadline over scheduled runs |
An alert should tell a human when the SLO is at risk, as early as is safe, and never otherwise. Two common rules fail at that.
- A threshold on the error rate (page if more than 1% of requests fail over 5 minutes) is noisy, because it pages for a two-minute blip that spends a sliver of the budget, and blind, because it never fires for a 0.5% error rate that spends the whole budget in under a week.
- An alert when the monthly budget is spent is accurate and too late.
The fix is the burn rate: how fast the budget is being spent compared with spending it evenly over the month. A burn rate of 1 uses exactly the whole budget by the end of the SLO window, so the share of the budget used is the burn rate times the alert window over the SLO window. The SLO fixes the error rate it allows, so a burn rate is an error rate in disguise: 14.4 against a 99.9% SLO is 14.4 × 0.1% = 1.44% of requests failing.
share of budget used = burn rate × window ÷ SLO window
lowest error rate = burn rate × (1 − SLO)
time to fire = window × burn rate × (1 − SLO) ÷ error rateC# · Burn rate 1 spends the whole budget over the month. The share used so far is the burn…
using System;
using System.Diagnostics;
// Burn rate 1 spends the whole budget over the month. The share used so far is the burn rate times the window over the month.
double BudgetUsed(double burn, double windowHours) => burn * windowHours / (30 * 24);
Debug.Assert(Math.Abs(BudgetUsed(14.4, 1) - 0.02) < 1e-12); // 2% of the budget in one hour
Debug.Assert(Math.Abs(BudgetUsed(6, 6) - 0.05) < 1e-12); // 5% in six hours
Debug.Assert(Math.Abs(BudgetUsed(1, 72) - 0.10) < 1e-12); // 10% in three days
// How long the budget lasts at a given burn rate, in days.
double DaysToExhaust(double burn) => 30 / burn;
Debug.Assert(Math.Abs(DaysToExhaust(14.4) - 2.083) < 0.001);
Debug.Assert(Math.Abs(DaysToExhaust(6) - 5) < 1e-12);
Debug.Assert(Math.Abs(DaysToExhaust(1000) * 24 * 60 - 43.2) < 1e-9); // a full outage burns at 1000: 43.2 minutes
// A rule with burn rate B over a window W cannot fire unless the error rate reaches B x (1 - SLO). Above that, from a quiet start,
// a steady error rate trips it after W x B x (1 - SLO) / error rate minutes.
double MinutesToFire(double burn, int windowMinutes, double slo, double errorRate) =>
errorRate < burn * (1 - slo) ? double.PositiveInfinity : windowMinutes * burn * (1 - slo) / errorRate;
Debug.Assert(Math.Abs(MinutesToFire(14.4, 60, 0.999, 1.0) - 0.864) < 1e-9); // a full outage pages in the first minute
Debug.Assert(Math.Abs(MinutesToFire(14.4, 60, 0.999, 0.10) - 8.64) < 1e-9); // 10% of requests failing: about nine minutes
Debug.Assert(double.IsPositiveInfinity(MinutesToFire(14.4, 60, 0.999, 0.01))); // 1% never reaches 1.44% in an hour
Debug.Assert(Math.Abs(MinutesToFire(6, 360, 0.999, 0.0082) - 263.4) < 0.1); // 0.8% plus background: about four and a half hours
// A service with ten requests an hour has few events to spend. 99.9% allows 7.2 failures a month, so one failure is 14% of the budget.
double AllowedFailures(double requestsPerMonth, double slo) => requestsPerMonth * (1 - slo);
Debug.Assert(Math.Abs(AllowedFailures(10 * 24 * 30, 0.999) - 7.2) < 1e-9);
Debug.Assert(Math.Abs(1 / AllowedFailures(10 * 24 * 30, 0.999) - 0.139) < 0.001);The Google SRE workbook turns this into a policy with several rules and two windows for each. A fast burn pages: a high burn rate over a short period means something is badly broken now. A slow burn files a ticket: a burn rate just above 1 for days means the budget will be gone before the month ends, and it can wait for working hours. Every rule needs two windows to exceed its threshold, a long one and a short one a twelfth of its length. The long window shows the problem is significant, and the short window shows it is still happening, so the alert stops soon after recovery instead of staying red for the rest of the long window.
| Severity | Burn rate | Long window | Short window | Budget used when it fires |
|---|---|---|---|---|
| Page | 14.4 | 1 hour | 5 minutes | 2% |
| Page | 6 | 6 hours | 30 minutes | 5% |
| Ticket | 1 | 3 days | 6 hours | 10% |
In a Prometheus-style system the share of failing requests over each window is a recording rule, and the alert combines two of them. The names are examples.
# page: 2% of the budget used in an hour, and still burning
slo:error_ratio:rate1h > 14.4 * 0.001
and
slo:error_ratio:rate5m > 14.4 * 0.001To see what the rules do, the next samples build a deliberately bad month at a 99.9% SLO (a budget of 43.2 failed minutes) and run five policies over it, minute by minute. A burn rate over a window is read from prefix sums of the per-minute error rate. A rule keeps its own state, an alert starts when a rule turns from not firing to firing, and an incident counts as caught by the first alert that starts during it or within three hours after it ends.
C# · An incident: from minute `Start` and for `Minutes`, a share `ErrorRate` of requests fail.
using System;
using System.Collections.Generic;
using System.Linq;
// An incident: from minute `Start` and for `Minutes`, a share `ErrorRate` of requests fail.
public sealed record Incident(string Kind, int Start, int Minutes, double ErrorRate)
{
public int End => Start + Minutes;
// The share of the month's error budget it uses: the failed minutes it causes over the failed minutes the SLO allows.
public double BudgetShare(double budgetMinutes) => ErrorRate * Minutes / budgetMinutes;
}
// Thirty days of per-minute error rates: a small background rate inside the SLO, plus incidents on top.
public sealed class Month
{
public const int Minutes = 30 * 24 * 60;
public readonly List<Incident> Incidents = new List<Incident>();
private readonly double[] errorRate = new double[Minutes];
private double[] prefix; // prefix[t] = errors in the first t minutes, for fast window averages
private readonly double slo;
public Month(double background, double slo)
{
this.slo = slo;
Array.Fill(errorRate, background);
}
public double BudgetMinutes => (1 - slo) * Minutes;
public void Add(Incident incident)
{
Incidents.Add(incident);
for (int t = incident.Start; t < incident.End; t++) errorRate[t] = Math.Min(1, errorRate[t] + incident.ErrorRate);
prefix = null;
}
// The burn rate over the `window` minutes up to minute t: the error rate relative to the rate the SLO allows.
public double Burn(int t, int window)
{
if (prefix == null)
{
prefix = new double[Minutes + 1];
for (int i = 0; i < Minutes; i++) prefix[i + 1] = prefix[i] + errorRate[i];
}
int from = Math.Max(0, t + 1 - window);
return (prefix[t + 1] - prefix[from]) / (t + 1 - from) / (1 - slo);
}
public bool Healthy(int t) => !Incidents.Any(i => t >= i.Start && t < i.End);
}
// A rule fires while the burn rate is at least `Burn` over the long window and, if there is a short window, over that too.
public sealed record Rule(double Burn, int Long, int Short)
{
public bool Fires(Month month, int t) => month.Burn(t, Long) >= Burn && (Short == 0 || month.Burn(t, Short) >= Burn);
}
public static class Alerting
{
// The minutes at which an alert starts: a rule turning from not firing to firing. Each rule keeps its own state.
public static List<int> Starts(Month month, params Rule[] rules)
{
var starts = new List<int>();
foreach (var rule in rules)
{
bool on = false;
for (int t = 0; t < Month.Minutes; t++)
{
bool now = rule.Fires(month, t);
if (now && !on) starts.Add(t);
on = now;
}
}
starts.Sort();
return starts;
}
// Minutes from the incident's start to the first alert that started during it (or up to `grace` minutes after), or null.
public static int? Detect(List<int> starts, Incident incident, int grace)
{
foreach (int start in starts)
if (start >= incident.Start && start <= incident.End + grace) return start - incident.Start;
return null;
}
// Minutes in which some rule was firing although no incident was under way: alerts that outlive the trouble.
public static int RedAfterRecovery(Month month, params Rule[] rules)
{
int red = 0;
for (int t = 0; t < Month.Minutes; t++)
if (month.Healthy(t) && rules.Any(r => r.Fires(month, t))) red++;
return red;
}
}The month has a background error rate of 0.02%, forty blips of one or two minutes with 5% to 20% of requests failing (each uses under 1% of the budget and none deserves a page), and six incidents at least three days apart, after a quiet first three days so that every window is full when trouble starts. The policies run from the crudest to the full design.
C#
using System;
using System.Diagnostics;
using System.Linq;
int At(int day, int hour) => (day * 24 + hour) * 60;
var month = new Month(0.0002, 0.999);
var slowBurnA = new Incident("slow burn 0.5%", At(3, 12), 20 * 60, 0.005);
var outage = new Incident("outage", At(8, 3), 25, 1.0);
var shortOutage = new Incident("short outage", At(12, 14), 6, 1.0);
var degradation = new Incident("degradation", At(16, 9), 90, 0.10);
var slowBurnB = new Incident("slow burn 0.8%", At(20, 2), 30 * 60, 0.008);
var chronic = new Incident("chronic 0.15%", At(24, 6), 5 * 24 * 60, 0.0015);
var scenario = new[] { slowBurnA, outage, shortOutage, degradation, slowBurnB, chronic };
foreach (var incident in scenario) month.Add(incident);
// Forty blips at random times, away from the six incidents so that every alert has one clear cause.
var blipRandom = new Random(5);
for (int placed = 0; placed < 40;)
{
int start = At(3, 0) + blipRandom.Next(Month.Minutes - At(3, 0) - 2);
if (scenario.Any(i => start + 2 > i.Start && start < i.End + 180)) continue;
month.Add(new Incident("blip", start, blipRandom.Next(1, 3), 0.05 + blipRandom.NextDouble() * 0.15));
placed++;
}
Debug.Assert(month.Incidents.Count(i => i.Kind == "blip") == 40);
Debug.Assert(month.Incidents.Where(i => i.Kind == "blip").All(i => i.BudgetShare(month.BudgetMinutes) < 0.01));
// The budget used by each incident, and by the month: the average burn rate over the month is the share of the budget spent.
double[] shares = scenario.Select(i => Math.Round(i.BudgetShare(month.BudgetMinutes), 3)).ToArray();
Debug.Assert(shares.SequenceEqual(new[] { 0.139, 0.579, 0.139, 0.208, 0.333, 0.25 }));
double spent = Enumerable.Range(0, Month.Minutes).Average(t => month.Burn(t, 1));
Debug.Assert(spent > 2.01 && spent < 2.03);
var policies = new (string Name, Rule[] Rules)[]
{
("error rate over 1% for 5 minutes", new[] { new Rule(10, 5, 0) }),
("burn 14.4 over 1 hour", new[] { new Rule(14.4, 60, 0) }),
("burn 14.4 over 1 hour, 6 over 6 hours", new[] { new Rule(14.4, 60, 0), new Rule(6, 360, 0) }),
("the same, with short windows", new[] { new Rule(14.4, 60, 5), new Rule(6, 360, 30) }),
("plus the ticket rule", new[] { new Rule(14.4, 60, 5), new Rule(6, 360, 30), new Rule(1, 4_320, 360) }),
};
// Per policy: minutes to the first alert for each incident (null: missed), alerts started, alerts tied to no incident,
// and minutes in which an alert was firing with no incident under way.
var expected = new (int?[] Detect, int Alerts, int Noise, int Red)[]
{
(new int?[] { null, 0, 0, 0, null, null }, 43, 39, 172),
(new int?[] { null, 0, 0, 8, null, null }, 3, 0, 169),
(new int?[] { null, 0, 0, 8, 260, null }, 7, 0, 1_150),
(new int?[] { null, 0, 0, 8, 260, null }, 8, 1, 103),
(new int?[] { 648, 0, 0, 8, 260, 2_149 }, 24, 11, 5_081),
};
for (int row = 0; row < policies.Length; row++)
{
var starts = Alerting.Starts(month, policies[row].Rules);
Debug.Assert(scenario.Select(i => Alerting.Detect(starts, i, 180)).SequenceEqual(expected[row].Detect));
Debug.Assert(starts.Count == expected[row].Alerts);
Debug.Assert(starts.Count(s => !scenario.Any(i => s >= i.Start && s <= i.End + 180)) == expected[row].Noise);
Debug.Assert(Alerting.RedAfterRecovery(month, policies[row].Rules) == expected[row].Red);
}
// The ticket rule on its own: 16 alerts, 10 of them re-fires on blips while an earlier incident was still inside its three-day window.
var ticketStarts = Alerting.Starts(month, new Rule(1, 4_320, 360));
Debug.Assert(ticketStarts.Count == 16);
Debug.Assert(ticketStarts.Count(s => !scenario.Any(i => s >= i.Start && s <= i.End + 180)) == 10);| Incident (share of the budget used) | Error rate over 1% for 5 min | Burn 14.4 over 1 h | 14.4 over 1 h, 6 over 6 h | The same, with short windows | Plus the ticket rule |
|---|---|---|---|---|---|
| Slow burn, 0.5% for 20 h (14%) | missed | missed | missed | missed | 648 min |
| Outage, 25 min (58%) | 0 | 0 | 0 | 0 | 0 |
| Short outage, 6 min (14%) | 0 | 0 | 0 | 0 | 0 |
| Degradation, 10% for 90 min (21%) | 0 | 8 | 8 | 8 | 8 |
| Slow burn, 0.8% for 30 h (33%) | missed | missed | 260 | 260 | 260 |
| Chronic, 0.15% for 5 days (25%) | missed | missed | missed | missed | 2,149 |
| Alerts started in the month | 43 | 3 | 7 | 8 | 24 |
| Of them tied to no incident | 39 | 0 | 0 | 1 | 11 |
| Minutes alerting with no incident under way | 172 | 169 | 1,150 | 103 | 5,081 |
Cells are minutes from the start of the incident to the first alert. The simulation evaluates every minute and has no delay; a real system adds the scrape interval and the rule evaluation interval.
- The error-rate threshold started 43 alerts, 39 of them for blips, and never noticed the three slow problems, which used 72% of the budget between them. It is loud and blind at once.
- One burn rate (14.4 over an hour) is precise: three pages, none for a blip, and the degradation after 8 minutes, as the formula says. But it cannot see anything below 1.44% errors, so the slow problems pass.
- Adding 6 over 6 hours pages the 0.8% slow burn after 260 minutes, when about 5% of the budget has gone. The cost shows in the last row: with long windows only, alerts stayed red for 1,150 minutes (19 hours) after the trouble was over, because a long window keeps remembering an outage until it slides out.
- Short windows keep the same detection and cut the red time to 103 minutes, with one extra page: a blip that landed almost six hours after the outage, while the outage was still inside the six-hour window, was enough to trip the 30-minute window. Long windows remember.
- The ticket rule (burn rate 1 over 3 days and 6 hours) catches what pages should not: the 0.5% slow burn after 648 minutes and the chronic problem after 2,149 minutes, a day and a half. At those rates the budget lasts 5.8 and 17.6 days, so they need a ticket during working hours, not a 3 a.m. page. Ten of its 16 alerts are re-fires on blips, because for three days after any large incident the long window stays above 1 and the 6-hour window needs only a small blip. A ticket queue keeps one open ticket per alert. A pager would not forgive it.
Four lessons carry over to real systems:
- A page is a statement about the budget. A burn rate of 14.4 means the budget is gone in two days, and a burn rate of 6 in five. Anything slower than that is real and still not an emergency.
- Use both windows. The long one answers "does this matter?" and the short one answers "is it still happening?".
- Low traffic breaks the arithmetic. A service with ten requests an hour has 7.2 failures a month to spend at 99.9%. One failed request is 14% of the budget and a 10% error rate for that hour (a burn rate of 100), so these rules would page for it. Alert on a larger unit (the whole journey or every endpoint together), require a minimum number of failures in the window, lengthen the windows, add synthetic probes for steady traffic, or set a looser SLO.
- Not everything is an SLO. A disk that will be full in four hours, a certificate that expires on Friday and a backup that has not run for two days are real and have no error rate. Alert on time to impact: predict the exhaustion and page when it is near enough to need a person.
A dashboard answers a question: is the service working, and if not, where do I look next? A layout that works puts the SLO and the remaining budget at the top, then the golden signals for the service (see the previous lesson), then the same signals broken down by whatever usually explains trouble (endpoint, region, version, customer tier), then the dependencies as seen from here, then resources. Mark deploys, configuration changes and flag flips on every graph, because the first question in most incidents is what changed. Link each panel to the logs and traces for the same time range. A page of fifty graphs that nobody has a question for is a liability, because the one that matters is hidden among them.
A page has to deserve its interruption. The SRE book's tests: does the alert detect a condition that is urgent, actionable and actively or imminently user-visible? Could the response be automated? Is someone else already being paged for the same cause? Can it be ignored safely? Every page has an owner and a runbook that says what it means, what to check first and how to mitigate. Review last week's pages: which were noise, which were duplicates, which needed no action, and delete or fix them. Alert fatigue is a reliability risk, because tired people stop reacting.
In an incident, mitigate before diagnosing. Roll back, fail over, turn off the feature flag, shed load, add capacity: whatever restores the SLO fastest, and then find the cause. Changes cause most incidents, so check recent deploys and flags first. One person coordinates, others investigate, one communicates, and a timeline is written as it happens. Afterwards a blameless postmortem looks for the contributing causes in the system and tracks its action items to completion. A postmortem that ends in "be more careful" has found nothing.
Prevention uses the same signals. A canary release compares the new version's SLIs with the old version's and rolls back by itself when they diverge (the performance testing platform designs that loop), and load tests and fault injection check that the alerts really fire. The load testing lesson turns an SLO into a pass condition.
An alerting system fails in quieter ways than a service does: by saying too much, by saying nothing, or by saying it to nobody.
| Failure | What goes wrong | Defence |
|---|---|---|
| Alert storm | One root cause fires hundreds of alerts and buries the one that matters | Page on symptoms such as SLO burn, group alerts, and inhibit dependents while the cause is firing (the metrics monitoring case study turns 452 alerts into 2 notifications) |
| Alerts that stay red | A long window keeps remembering an outage after recovery (1,150 minutes in the simulation) | A short window on every rule, and an automatic resolve |
| Untested rules | A typo in a label name means the rule has never matched anything | Unit-test rules against recorded series, replay past incidents, and inject faults in game days to watch the alert fire |
| A broken paging path | The rule fires and nothing reaches a person: a wrong route, an empty rota, the provider down | A heartbeat alert that must always arrive, end-to-end test pages, escalation when a page is not acknowledged |
| Pages nobody can act on | No owner, no runbook, a cause outside the team's control | An owner and a runbook on every page, a weekly review of pages, delete what needs no action |
| Low traffic | One failure is a large share of the hour, so the rules page for single requests | Alert on a larger unit, require a minimum number of failures, lengthen the windows, add probes |
Interviewer follow-upL5Define SLI, SLO, SLA and error budget, and say how much downtime 99.9% allows.How to answer
An SLI is a measurement of good events over valid events. An SLO is a target for it over a window. An SLA is a contractual promise with consequences, set looser than the SLO. The error budget is what the SLO leaves. 99.9% over 30 days allows 43.2 minutes, and a full outage uses it at 1,000 times the sustainable rate, so it is gone in 43 minutes.
Interviewer follow-upL6Why alert on burn rate instead of an error-rate threshold?How to answer
A threshold is either noisy (a two-minute blip pages) or blind (a 0.5% error rate that spends the budget in a week never crosses it). Burn rate ties the alert to what you care about: how soon the SLO is lost. Pages use a high burn rate over a short period, tickets a burn rate near 1 over days, and each rule needs a long and a short window so that it is significant and still happening. In the simulation the threshold started 43 alerts of which 39 were blips and missed all three slow problems, while the multi-window pages had one noisy alert in eight.
Interviewer follow-upL6A service handles ten requests an hour and pages constantly under burn-rate rules. Why, and what do you change?How to answer
At ten requests an hour, 99.9% allows 7.2 failures a month, so one failed request is 14% of the budget and a 10% error rate for that hour, a burn rate of 100 against a threshold of 14.4. The rules are right and the traffic is too thin for percentages. Alert on a larger unit (the whole journey, or every endpoint together), require a minimum number of failures in the window, lengthen the windows, add synthetic probes for a steady stream of events, or accept a looser SLO for the service.
Interviewer follow-upL7A dependency you do not own is 99.5% available and your SLO is 99.9%. What can you do?How to answer
A hard dependency in series caps you below 99.5%, since availabilities multiply, so promising 99.9% is dishonest unless the arithmetic changes. Make the call optional or asynchronous, serve stale or cached data when it fails, add a second provider (two independent 99.5% copies give 99.9975%), retry transient failures within a budget, or ask the owner for a better objective. Measure the dependency's contribution separately so that the budget burn is attributed correctly. If none of that is possible, set a lower SLO and say why.
Interviewer follow-upL7How do you agree SLOs with product, and what happens when the budget is gone?How to answer
Start from user journeys and measured history, propose a target with the price of each extra nine (minutes of allowed failure, engineering effort), and agree an error budget policy in advance with product and engineering leadership: when the budget is spent, risky launches pause and the team works on reliability until it recovers, with exceptions signed off explicitly. Review the targets every quarter. The policy works because everyone accepted it before the incident, so nobody argues during one. Test the alerts as well: replay past months through the rules, as the simulation does, and check detection time and false pages before trusting them.
When asked how you would run a service reliably, go through six things in order, one or two sentences each.
- User journeys and SLIs. "For checkout: the share of orders acknowledged in under two seconds, measured at the edge."
- SLOs in minutes. "99.9% over 30 days is 43 minutes of budget. Dependencies at 99.9% in series cap it near 99.7%, so I would cache or degrade around the optional ones."
- Alerts. Burn rate with two windows: page at 14.4 over an hour and 6 over six hours, ticket at 1 over three days. No pages for causes such as CPU.
- The budget policy. What happens when the budget is spent, agreed in advance.
- Incidents. Mitigate first, then diagnose, then a blameless postmortem with tracked actions.
- Testing. Replay history through the rules, inject faults to watch the alerts fire, and keep a heartbeat on the paging path.
An SLI is good events over valid events, an SLO is a target for it, and the error budget it leaves (43.2 minutes a month at 99.9%) is spent on purpose. Dependencies in series multiply away nines: three at 99.9% give 99.7%. Alert on burn rate with two windows. In a simulated bad month that spent twice its budget, an error-rate threshold started 43 alerts, 39 of them for blips, and missed every slow problem. A burn rate of 14.4 over an hour (with a 5-minute window) and 6 over six hours (with a 30-minute window) paged for the outage, the degradation and the 0.8% slow burn with one noisy page in eight, and the same rules without short windows stayed red for 1,150 minutes after recovery against 103. A ticket rule (burn rate 1 over three days and six hours) caught the two problems that were too slow to page, after 648 and 2,149 minutes. Low traffic breaks percentages, pages must be urgent and actionable, incidents are mitigated before they are diagnosed, and the alert path needs a heartbeat and tests.
Try answering out loud before you reveal each answer.
QuestionA service has a 99.9% SLO over 30 days. How much downtime does that allow, and what burn rate is a full outage?Reveal answer
43.2 minutes, from 0.1% of 30 days. A full outage fails 100% of requests against the 0.1% the SLO allows, a burn rate of 1,000, so the whole month's budget is gone in 43.2 minutes. A 25-minute outage spends 58% of it.
QuestionWhy does each burn-rate rule need both a long and a short window?Reveal answer
The long window shows that the problem is significant (a blip cannot spend 2% of the budget), and the short window shows that it is still happening, so the alert resets soon after recovery. In the simulation, the same rules with long windows only stayed red for 1,150 minutes after the trouble ended, against 103 minutes with short windows.
QuestionA service has been failing 0.5% of requests for a day against a 99.9% SLO, and nobody was paged. Is that a bug in the alerting?Reveal answer
Not necessarily. The burn rate is about 5.2, below the 6 needed to page, and at that rate the budget lasts almost six days, so the design says it is a ticket and not an emergency. In the simulation the ticket rule fired after 648 minutes. If the service is critical and six days is too long to be warned, lower the page threshold and accept more pages.
QuestionA service gets ten requests an hour and has a 99.9% SLO. One request fails. What do the burn-rate rules do, and why?Reveal answer
One failure is 10% of that hour's requests, a burn rate of 100, so the 14.4 rule pages, although the failure is 14% of the month's budget of 7.2 failures and no emergency. With so few events a percentage is the wrong tool. Alert on a larger unit, require a minimum number of failures, lengthen the windows or add probes.
QuestionA request passes through three services in series, each 99.9% available. What is the best SLO you can promise, and how do you do better?Reveal answer
About 99.7%, since 0.999 × 0.999 × 0.999 = 0.997. To promise more you need redundancy (independent copies in parallel: two 99.9% copies give 99.9999%) or graceful degradation that makes some of the dependencies optional, such as serving stale data.
- Beyer, Jones, Petoff and Murphy (eds.), Site Reliability Engineering, O'Reilly, 2016: the chapters Service Level Objectives (opens in a new tab) (SLIs, SLOs, choosing targets) and Monitoring Distributed Systems (opens in a new tab) (symptoms versus causes, what makes a good page).
- Beyer, Murphy, Rensin, Kawahara and Thorne (eds.), The Site Reliability Workbook, O'Reilly, 2018: Alerting on SLOs (opens in a new tab) (burn rates, multiple windows, the 14.4, 6 and 1 policy) and Implementing SLOs (opens in a new tab).
- Prometheus documentation, Alerting (opens in a new tab): alert on symptoms, keep pages actionable.