Week 5: SLOs, SLIs, Error Budgets
Theme: Define and measure service reliability quantitatively.
Learning Objectives
- Define SLIs (latency, availability, throughput, durability) from metrics
- Set SLO targets based on user expectations
- Calculate error budget and error budget burn rate
- Implement burn-rate alerts in Prometheus
Reading Materials
- Google SRE Book - Chapter 4: Service Level Objectives
- Google SRE Workbook - Chapter 5: Alerting on SLOs
- SLOs with Prometheus (Robust Perception)
- Error Budget Burn Rate Alerts (Grafana)
- Sloth - SLO Generator
Finger Exercises (choose 2)
- Install
slothand generate SLO rules for the Go app. - Write a PromQL query to calculate error budget remaining for a 99.9% SLO over 30 days.
- Set up a burn-rate alert using the multi-window ratio technique with fast (5m) and slow (1h) burn rate windows.
Project
Define 3 SLOs for the Phase 1 app:
- Latency SLO: 99% of requests < 500ms over 30 days
- Availability SLO: 99.9% of requests succeed over 30 days
- Throughput SLO: 95% of orders processed within 5s over 7 days
Implement burn-rate alerts using Prometheus recording rules (or sloth). Create a Grafana "SLO Dashboard" showing:
- SLI values over time
- Error budget remaining
- Burn rate (fast/slow)
- SLO status (compliant / at risk / burning)
Write a brief document explaining each SLO choice and the user journey it maps to.
Time Budget
| Activity | Time |
|---|---|
| Reading | 2 hrs |
| Finger exercises | 1.5 hrs |
| Project | 2.5 hrs |
| Total | 6 hrs |