Interview Prep/SRE & Reliability/Error Budgets & Burn-Rate Alerting

What is the problem with computing a 30-day ratio as `avg_over_time` of a 5-minute ratio?

AdvancedConceptError Budgets & Burn-Rate Alerting
Answer

avg_over_time(slo:sli_error:ratio_rate5m[30d]) weighs every 5-minute window equally regardless of traffic, so it becomes a time-based SLI. A 5-minute outage at 3 AM with 10 requests counts as much as one at peak with 100,000. For a request-based SLO, compute the ratio of sums instead:

sum(increase(http_requests_total{job="checkout",code=~"5.."}[30d]))
/
sum(increase(http_requests_total{job="checkout"}[30d]))

or record per-window error and total counts separately and divide the sums.

All SRE & Reliability questions Roadmap: SRE & incident response

More on Error Budgets & Burn-Rate Alerting