SLOs and error budgets
A service-level indicator (SLI) measures a user-facing outcome. A service-level objective (SLO) sets its target over a stated window. An error budget is the amount of failure the target permits. 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. Do not average percentages from unequal traffic windows. Add success and total counts before dividing, and never infer contractual SLA compliance from process uptime.
Formal Syntax & Structure
Conceptual contract; see exampleWorking Example
const total=10000, failed=7, targetPerThousand=999;const budget=total*(1000-targetPerThousand)/1000;console.log(budget, budget-failed, failed/budget);