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

How do you compute "error budget remaining" in PromQL?

AdvancedConceptError Budgets & Burn-Rate Alerting
Answer
1 - (
  slo:sli_error:ratio_rate30d{slo="checkout-availability"}
  / (1 - 0.999)
)

1 means the full budget is left, 0 means exhausted, negative means you are over budget. Display it as a percentage stat panel with thresholds at 50%, 25% and 0%. Note that rate(...[30d]) is expensive; compute it in a recording rule in its own group with a longer interval (for example 5m) so it does not run on every evaluation cycle.

All SRE & Reliability questions Roadmap: SRE & incident response

More on Error Budgets & Burn-Rate Alerting