SLOs, error budgets and alerting
Answer saving: the right SLI denominator, request budgets, dependencies and checking alerts over two windows.
What counts as a good save
A learner saves an answer. The interface should confirm the save only after storage acknowledges it. We will use this fictional service to decide what to measure and when an operator should act.
An eligible attempt is an authenticated, correctly formed save request. Each retry is another attempt. A good attempt receives a durable acknowledgement within 800 ms. A timeout, a server error or an acknowledgement after 800 ms counts as one bad attempt. Count it once even if several conditions apply. Invalid requests are excluded by the agreed classification rule.
If an interval contains eligible attempts and bad ones, its SLI is . Our SLO is at least 99.5% good attempts over the preceding 14 days. It is a measurable target. An SLA adds contractual commitments and consequences; an internal target alone does not create a compensation contract.
Measure both counts at the same boundary. A gateway can observe requests that reached it, but cannot see a client that never connected. No observations means the SLI is undefined, not 100% success.
Counts and budget units
Add counts before dividing. Suppose eleven minutes each contain 100 successful saves, and one quiet minute contains a single failed save. There are 1,101 attempts and one failure: the bad fraction is . Averaging the twelve minute percentages gives : it gives the quiet minute the same weight as a hundred-request minute.
For a request-based objective , the error budget is bad attempts. At 99.5%, the allowed fraction is . If , at most 50 attempts may be bad. The budget used is ; multiply by 100 to express it as a percentage.
For a time-based objective, the allowance is minutes. Over 14 days, minutes, so 99.5% allows 100.8 minutes of downtime. These are different indicators. An outage during a busy lesson can affect more attempts than an equally long outage at night. Request counts are needed to charge either incident to a request budget.
Each additional nine divides the permitted fraction by ten. A rolling window updates the numerator and denominator as old observations leave it; it does not wait for the next calendar month to reset.
Dependencies and shared failures
Saving needs both a gateway and storage. If their working states are independent, their joint availability is the product:
For and , this is . This is a probability model, not a prediction of the measured request SLI: latency and failures outside the measurement boundary still matter.
If either of two independent replicas suffices, both must fail for the pair to fail:
Two replicas at 0.998 give . But if they also require a shared router with availability 0.999, independent of those replica failures, the result is . A simultaneous bad configuration push also breaks the assumption of independent replica failures. More replicas do not remove a dependency they all share.
Burn rate and two windows
The burn rate normalizes the observed bad fraction by the allowed fraction:
At , a 5% bad fraction means burn rate 10. This normalization does not by itself specify an alert. For our fictional service we choose:
- Page: windows of 12 and 3 minutes, at least 5% bad attempts in each, and at least 900 attempts in the 12-minute window.
- Investigation ticket: windows of 180 and 30 minutes, at least 1% bad attempts in each, and at least 600 attempts in the 180-minute window.
At each complete minute: sum attempts and bad outcomes for each window → compute both bad fractions → check both thresholds and the volume floor → route an active condition. The recent window checks whether trouble is continuing. A high long-window fraction with a healthy recent window does not trigger this detector.
These values are experiment inputs, not universal recommendations. A reference trace has 1,000 attempts per minute from 08:00 to 18:00 and 100 otherwise. The windows immediately before the deployment contain only successful attempts. On day 4, 200 of each minute's 1,000 saves fail from 11:10 to 11:22. The page first activates at 11:13: three failing minute buckets contain 600 failures within 12,000 attempts in the long window, exactly 5%. It is last active at 11:24 and clears at 11:25. Timestamps mark the end of a complete bucket; days start at zero.
For a subwindow with attempts in a reporting period with attempts, its share of the request budget is . Replacing that request share by elapsed-time share, , is valid only at constant traffic.
Response and limitations
Across the full 14-day fixture, 9,575,901 attempts include 2,941 bad outcomes: SLI 99.969287%, with 6.142503% of the budget used. The period's SLO is met, but the failed deployment still needs attention. A longer moderate incident creates a ticket. Passing the period target is not a reason to ignore a current failure.
The response policy assigns an owner and a decision. Before release, check telemetry and rollback readiness. During a failure, the owner checks whether to roll back or restrict new writes while keeping the learner's unsaved answer locally. Repeated page and ticket conditions from the same incident should update its record, not summon people repeatedly. At the next release review, consider the remaining budget, unresolved incidents and the proposed mitigation; there is no automatic “budget zero → freeze every release” rule in this example.
Two limitations are part of the design. No data is not success: missing telemetry needs its own check. A minimum-volume condition can hide a complete low-traffic outage: one failed attempt per minute never reaches a floor of 900 attempts over 12 minutes. Use a separate probe and a suitable low-volume policy.
The optional notebook reproduces the counts and alert times without downloads. It does not model Prometheus scrapes or notification delivery and does not affect mastery. Next, Resilience and capacity covers how timeouts, retries and load shedding limit the failures a dependency can cause.
Check your understanding
The same questions as in Pulse. Answers are shared between modes.
Go deeper — optional
Code and labs do not count toward the main percentage or the certificate.
- Answer-save SLO: counts and windowsoptional
Reproduce request budgets and alert times on fictional traffic. Check observation weighting, low volume and no-data behavior. No downloads or third-party libraries.
~20 min · easier on a computer · The SLO lesson and basic Python lists and functions.
Self-check in the notebook — not part of mastery or the certificate.
Answers are saved on the server and tied to this browser until you sign in.