SLI — Service Level Indicator (metric). SLO — Service Level Objective (target). SLA — Service Level Agreement (contract).
1# SLI: Availability2sli_availability = successful_requests / total_requests34# SLO: 99.9% availability5slo_availability = 0.99967# Error Budget8error_budget = 1 - slo = 0.0019error_budget_minutes = 0.001 * 30 * 24 * 60 = 43.2 minutes/month1011# SLA: penalties for violation12sla_terms:13 - availability < 99.9%: credit 10%14 - availability < 99.0%: credit 30%15 - availability < 95.0%: credit 50%
1# Prometheus alert based on SLO2groups:3 - name: slo4 rules:5 - alert: ErrorBudgetBurnRate6 expr: |7 (8 1 - (sum(rate(http_requests_total{status=~"2.."}[1h])) /9 sum(rate(http_requests_total[1h])))10 ) > (14.4 * 0.001)11 for: 1h12 labels:13 severity: critical
Formula: Error Budget = 1 - SLO. If SLO = 99.9%, then Error Budget = 0.1% = 43 min/month.