How-To Guide

Calculating SLO Error Budgets and Multi-Window Burn

Translate availability SLO targets into concrete monthly error budgets, compute multi-window burn-rate alerts, and manage release freezes objectively.

On this page

  1. Why Error Budgets Align Reliability and Release Velocity
  2. Translating Nines into Time and Request Quotas
  3. Multi-Window Burn Rate Math and Prometheus Rules
  4. Programmatic Budget Gate in Release Pipelines
  5. Common SLO Anti-Patterns and Edge Cases
  6. Auditing Burn Rules and Testing Release Gates

Why Error Budgets Align Reliability and Release Velocity

Setting a target of “100% reliability” is counterproductive for nearly every software system except safety-critical avionics or pacemakers. Chasing zero failures freezes deployments, forces heavyweight manual approval boards, and burns out on-call rotations. Conversely, shipping blindly without quantitative reliability boundaries erodes customer trust until major enterprise accounts churn.

Service Level Objectives (SLOs) resolve this tension through an explicit error budget: error_budget = 1 - SLO. If a payment API commits to a 99.9% 30-day availability SLO, it explicitly budgets 0.1% failure tolerance—either 43.2 minutes of equivalent full outage or 100,000 failed requests out of 100,000,000 total eligible requests. As long as error budget remains positive, engineering teams ship new features rapidly; once unbudgeted outages exhaust the budget, non-emergency feature launches pause so teams invest directly in resilience engineering.

An effective error budget policy converts budget numbers into pre-agreed team governance rules before an outage happens. When teams agree in advance that dropping below 10% remaining budget pauses experimental rollouts—while still permitting security patches and reliability fixes—incident retrospectives stop turning into political negotiations between product managers and infrastructure engineers. Everyone looks at the exact same rolling compliance window and lets the remaining budget dictate priorities objectively.

You can convert SLA/SLO percentages (99.9%, 99.95%, 99.99%) into daily, weekly, monthly, and yearly error allowances and burn-rate tables immediately in the Interactive SLA Uptime Calculator.

Translating Nines into Time and Request Quotas

Small fractions of a percent create dramatic operational differences across a standard 30-day (720-hour / 43,200-minute) compliance window:

  • 99.0% (“two nines”): 1.0% error budget = 7.2 hours per 30 days. Suitable for internal admin tooling, non-urgent batch exporters, or staging sandboxes.
  • 99.9% (“three nines”): 0.1% error budget = 43.2 minutes per 30 days (8.76 hours/year). The sweet spot for most customer-facing B2B SaaS APIs, allowing automated canary rollbacks without paging on 30-second DNS blips.
  • 99.95%: 0.05% error budget = 21.6 minutes per 30 days. Common for checkout gateways and enterprise SSO authentication endpoints.
  • 99.99% (“four nines”): 0.01% error budget = 4.32 minutes per 30 days. Demands automated multi-AZ failover, zero-downtime migrations, and no manual human intervention on critical recovery paths.

Note the vital distinction between external SLAs and internal SLOs. Always set your internal engineering SLO stricter than your contractual SLA (for example, 99.95% internal SLO backing a 99.9% customer SLA). That buffer alerts engineers and triggers feature freezes before financial SLA service credits ever trigger.

Multi-Window Burn Rate Math and Prometheus Rules

Naively paging whenever error_rate > 0.1% over five minutes causes alert fatigue: a 0.2% error burst for five minutes consumes less than 0.03% of a 30-day budget and does not justify waking an engineer at 2:00 AM. On the other hand, waiting for a 30-day rolling counter to cross 100% catches outages weeks too late.

Google SRE’s burn rate formulation solves both problems by normalizing failure speed against budget lifespan. A burn rate of 1.0 consumes exactly 100% of your 30-day budget in 30 days (720 hours). A burn rate of 14.4 consumes 2% of the entire monthly budget in just 1 hour (exhausting the full month in 50 hours). Requiring both a long window (1h) and a short confirmation window (5m) to exceed the burn threshold simultaneously ensures instant alert clearance the moment mitigation succeeds.

groups:
  - name: api_slo_burn_rates
    rules:
      # Pre-aggregate 5xx + timeout ratio across 5m and 1h slices
      - record: api:http_error_ratio:rate5m
        expr: |
          sum(rate(http_requests_total{service="checkout",status=~"5.."}[5m]))
          /
          sum(rate(http_requests_total{service="checkout"}[5m]))

      - record: api:http_error_ratio:rate1h
        expr: |
          sum(rate(http_requests_total{service="checkout",status=~"5.."}[1h]))
          /
          sum(rate(http_requests_total{service="checkout"}[1h]))

      # Page immediately: 14.4x burn rate (2% monthly budget burned in 1h)
      # SLO = 99.9% -> error budget = 0.001 -> 14.4 * 0.001 = 0.0144
      - alert: CheckoutSloFastBurnCritical
        expr: |
          api:http_error_ratio:rate1h > (14.4 * 0.001)
          and
          api:http_error_ratio:rate5m > (14.4 * 0.001)
          and
          sum(rate(http_requests_total{service="checkout"}[5m])) > 1
        for: 2m
        labels:
          severity: page
        annotations:
          summary: "Checkout burning 30d error budget at >14.4x rate"

      # Ticket only: 3x burn rate across 6h + 30m windows
      - alert: CheckoutSloSlowBurnWarning
        expr: |
          sum(rate(http_requests_total{service="checkout",status=~"5.."}[6h]))
          / sum(rate(http_requests_total{service="checkout"}[6h])) > (6 * 0.001)
          and
          sum(rate(http_requests_total{service="checkout",status=~"5.."}[30m]))
          / sum(rate(http_requests_total{service="checkout"}[30m])) > (6 * 0.001)
        labels:
          severity: ticket

Look closely at the third and guard in the page rule (sum(rate(...)) > 1 requests/sec). Low-traffic services running at 0.05 RPS in staging or overnight can hit a 50% error ratio from two isolated requests; adding a minimum traffic floor (or pairing request-based SLIs with synthetic blackbox probes) prevents bogus midnight pages.

Programmatic Budget Gate in Release Pipelines

Beyond paging humans, error budgets shine when wired into automated deployment gates. A concise TypeScript check inside your GitHub Actions workflow queries your metrics backend before promoting a canary to 100% production traffic, freezing risky releases whenever remaining 30-day budget dips below 10%.

export interface BudgetSnapshot {
  sloTarget: number;        // e.g. 0.999
  totalRequests: number;    // 30d eligible requests
  badRequests: number;      // 30d 5xx + timeout failures
}

export function evaluateErrorBudget(s: BudgetSnapshot) {
  if (s.totalRequests <= 0) {
    return { remainingFraction: 1, consumedPercent: 0, allowFeatureRelease: true };
  }
  const allowedBad = s.totalRequests * (1 - s.sloTarget);
  const consumedFraction = allowedBad === 0 ? 1 : s.badRequests / allowedBad;
  const remainingFraction = Math.max(0, 1 - consumedFraction);

  return {
    allowedBadRequests: Math.floor(allowedBad),
    consumedPercent: Number((consumedFraction * 100).toFixed(2)),
    remainingFraction: Number(remainingFraction.toFixed(4)),
    allowFeatureRelease: remainingFraction > 0.1,
  };
}

Common SLO Anti-Patterns and Edge Cases

Watch for four pitfalls that silently invalidate error budget dashboards:

  • Counting 400/401/404 client errors against server SLOs: A scrapers-driven 404 spike or user password typo (401) reflects client input rather than server unavailability. Exclude 4xx responses (except 429 if caused by internal capacity starvation rather than per-tenant abuse) from the bad-request numerator.
  • Hidden dependency ceiling mismatch: Promising a 99.99% SLO when your critical upstream payment processor only guarantees 99.9% is mathematically impossible unless you design an asynchronous fallback queue or multi-provider failover.
  • Measuring only inside the app pod: If an ingress load balancer drops TLS connections or Kubernetes drains pods prematurely with 502 Bad Gateway, in-process application Prometheus counters never even see those failed requests. Always derive primary availability SLIs at the edge proxy or synthetic probe layer.
  • Ignoring latency SLOs: An endpoint returning 200 OK in 22 seconds technically passes availability while breaking every browser user’s patience. Track a twin latency SLI (http_request_duration_seconds_bucket{le="0.5"} >= 99%) alongside error rate.

Auditing Burn Rules and Testing Release Gates

Before activating automated pages or release freezes, validate your math in the Interactive SLA Uptime Calculator and test your PromQL and pipeline helpers against four scenarios:

  1. Simulate a 3-minute 100% outage on a 99.9% SLO service and verify CheckoutSloFastBurnCritical triggers cleanly inside 5 minutes and resolves within 5 minutes after traffic recovers—not 60 minutes later.
  2. Feed synthetic low-traffic bursts (2 errors out of 4 total health checks overnight) and confirm the minimum RPS guard suppresses paging.
  3. Unit-test evaluateErrorBudget with 0 requests, 50% consumed budget, and 105% over-budget exhaustion so CI deployment gates fail closed cleanly when metrics are over budget.
  4. Review rolling window vs calendar-month resets with stakeholders: rolling 28-day or 30-day windows prevent teams from burning 100% of their budget on the 29th of the month knowing an artificial reset arrives forty-eight hours later.

FAQ

Why shouldn't every internal microservice chase a 99.999% SLO?
Moving from 99.9% (43.8 minutes/month) to 99.999% (26 seconds/month) leaves zero room for ordinary automated failovers or schema migrations and demands active-active multi-region infrastructure that multiplies cost and operational complexity.
Why does multi-window alerting check both a 1-hour and a 5-minute window together?
Pairing a longer window (1 hour) with a shorter confirmation window (5 minutes) catches sustained high-burn outages fast while stopping the alert immediately once the incident resolves—avoiding alerts that linger open for 55 minutes after recovery.
How do error budgets differ for request-based SLIs versus time-based uptime SLIs?
Time-based uptime treats every minute identically even at 3:00 AM with ten users online. Request-based SLIs weight downtime by real user traffic, ensuring peak-hour failures consume error budget proportionally faster.

Related Examples

Interactive Tools for This Topic