SLIs, SLOs and error budgets
Quick answer
An SLI measures service behavior, an SLO specifies a target over a defined window, and an error budget quantifies the allowed bad events.
If 10000 eligible requests have a 99.9 percent success objective, the event-based error budget is 10 failures. Six failures consume 60 percent of that budget. Always define the eligible population and time window; a missing measurement is not a successful request.
Prepare the practice environment
Run python3 lab-fixtures/observability/setup.py from the extracted root as an ordinary user. Enter the printed fresh private path and check pwd. Use fresh fixtures, Bash with set -e -o pipefail, LC_ALL=C and umask 077. Run each snippet in a separate Bash process, not your interactive shell. Only private files are used; optional examples require an authorized snapshot VM. Do not change live monitoring or services. All supplied records are fictional. Review the lab guide.
Prerequisites
Review: Metrics, logs and traces.
How it works
For this request-based SLI, good requests are successful eligible requests; define exclusions in advance. The ratio is good / total, not a mean of per-instance percentages. For a 99.9% SLO, the bad fraction allowed is 0.001. With 10000 eligible requests, the allowance is 10 failures; 6 failures consume 60% of the budget and leave 4. A latency SLI could count eligible requests completed within 200 ms; define whether errors count as bad even if fast. A window with no eligible requests has an undefined ratio, not automatic success. Burn rate is observed bad fraction divided by allowed bad fraction; a rate of 2 consumes budget twice the sustainable rate if maintained. Short windows are noisy; combine windows and actionability in alert design. An SLA is a service agreement, not identical to an internal SLO. Budget policy guides decisions about release risk; it is not punishment. Request-based objectives are not interchangeable with minutes of downtime.
Try the examples
Use exact decimal arithmetic for the example; the allowance can be fractional for other totals.
Expected stdout:
SLI 99.94%; allowed 10; remaining 4; consumed 60.0%Two failures in 1000 requests are 0.2%, twice the allowed fraction.
Expected stdout:
burn 2.00xThe ratio is undefined and should be displayed as missing, not 100%.
Expected stdout:
undefined: no eligible requestsCommon mistakes
Do not average ratios without weighting by eligible counts or silently change the SLI denominator.
Practice
Calculate remaining budget for 20000 requests and 14 failures at 99.9%. Explain whether a release policy should respond and why the window matters.
Related references
Study: awk. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
SLIs, SLOs and error budgets — Knowledge Check
Apply observability and reliability concepts to synthetic fixtures and VM-only scenarios.
What is an SLO?
At 99.9%, how many failures are allowed in 10000 requests?
What is a zero-request success ratio?
What does a 2x burn rate mean?