Interview Prep/SRE & Reliability/SLO Design & Error Budget Decisions

You inherit SLO recording rules where the 30-day availability is `avg_over_time(sli_ratio_5m[30d])`. Is anything wrong?

AdvancedScenarioSLO Design & Error Budget Decisions
Answer

Situation read → Averaging 5-minute ratios gives each window equal weight regardless of traffic: it is a time-based SLI disguised as a request-based one. Night-time outages and peak outages count the same.

What I'd do →

  1. Replace it with a ratio of sums over the window:
    sum(increase(http_requests_total{job="checkout",code=~"5.."}[30d]))
    / sum(increase(http_requests_total{job="checkout"}[30d]))
    
  2. Put it in a rule group with a 5-minute interval to keep the cost down.
  3. Compare old and new values for the last month and explain the difference to stakeholders.
  4. Generate future rules with Sloth or Pyrra to avoid hand-written mistakes.

Why → The SLI must match the SLO definition; a request-based SLO needs request-weighted math.

Interview tip → Explaining why averages of ratios are wrong is a strong senior signal.

All SRE & Reliability questions Roadmap: SRE & incident response

More on SLO Design & Error Budget Decisions