SLOs and error budgets
Prerequisite: node-release-promotion-and-rollback. Objective: Interpret synthetic availability data. Each example is independent. Use Node.js 22.16.0 in a disposable directory; save as main.mjs and run node main.mjs. No external service is contacted.
How it works
For a request-based availability SLI, divide successful eligible requests by all eligible requests. Define eligibility and success before counting; do not silently discard timeouts. For a 99.9% target over 10,000 eligible requests, the budget is ten failures. Burn rate compares the observed failure fraction with the allowed fraction. A short-window spike can justify a fast alert; a sustained smaller burn may need a slower alert. An SLA is a separate agreement with consequences, not simply another name for an SLO. No traffic means no measured request success ratio, not perfect availability.
Calculate budget consumption
const total=10000, failed=7, targetPerThousand=999;const budget=total*(1000-targetPerThousand)/1000;console.log(budget, budget-failed, failed/budget);Expected output:
10 3 0.7Seven failures consume 70% of the ten-request budget.
Compare burn across windows
function burn(total,failed){return total===0?null:(failed/total)/0.001;}console.log(burn(1000,4),burn(10000,10),burn(0,0));Expected output:
4 1 nullA fourfold burn is relative to the 0.1% allowance; zero observations return null.
Common mistake
Do not average percentages from unequal traffic windows. Add success and total counts before dividing, and never infer contractual SLA compliance from process uptime.
Practice
For two windows containing 100 requests with one failure and 900 with zero failures, compute the combined SLI and compare it with a 99.9% target.
Reference candidate: node-slos-and-error-budgets-lookup (route unverified). Documentation anchor: https://sre.google/workbook/implementing-slos/ (related documentation, not exact-version validation).
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
SLOs and error budgets — knowledge check
Apply the lesson to a fresh scenario and explain the evidence boundary.
What is the budget for 20,000 eligible requests at 99.9%?
What does a zero-request window establish?
What does burn rate 4 mean?