Library

Volume 1 · CI/CD, DevOps & Observability

Notebook
Sign in

Section 34

SLO/SLA Design (SLI/SLO/SLA/Error Budget framework, burn-rate alerts)

485 words · about 2 min

34.1 Definitions

Term Definition Example
SLI Quantitative measure of service performance 99.5% of requests complete in <200ms
SLO Target value for an SLI 99.9% availability over 30 days
SLA Contract with consequences for missing SLOs 10% refund if availability drops below 99.5%
Error Budget Allowed unreliability (1 − SLO) 0.1% = 43.2 min downtime/month

34.2 SLO Design Framework

Step 1 — Identify critical user journeys (login, checkout, search, dashboard — each may need distinct SLOs).

Step 2 — Define SLIs:

Availability SLI: Successful requests / Total requests (exclude client 4xx)
Latency SLI: Requests within threshold / Total requests (p50 <100ms, p99 <500ms)
Correctness SLI: Correct responses / Total responses
Freshness SLI (data): Data age < threshold / Total data points

Step 3 — Set targets by tier:

Tier 1 (Business Critical — Payments, Auth):
  Availability: 99.99% (52 min/year error budget) | Latency p99: 200ms
Tier 2 (Important — Search, Recommendations):
  Availability: 99.9%  (8.76 hrs/year)             | Latency p99: 500ms
Tier 3 (Internal — Analytics, Reporting):
  Availability: 99.5%  (1.83 days/year)             | Latency p99: 2000ms

Step 4 — Error budget policy:

> 50% remaining  → Normal development velocity
25-50% remaining → Prioritize reliability work (20% team capacity)
< 25% remaining  → Feature freeze, focus on reliability
Exhausted        → All hands on reliability, incident review required

34.3 Multi-Window, Multi-Burn-Rate Alerts

Burn rate 14.4x for 1 hour  → Page (fast, severe)
Burn rate 6x for 6 hours    → Page
Burn rate 3x for 1 day      → Ticket
Burn rate 1x for 3 days     → Ticket (slow trending)

This avoids two failure modes of simple threshold alerts: paging on a brief blip (noise) and missing a slow-burning leak that would exhaust the budget over days (silence).

34.4 SLOs for Gen AI / LLM Systems

LLM systems break the traditional SLO mold: latency is inherently variable (1–30s generation), quality is subjective, and cost scales with usage.

Availability SLO: 99.9% success (excl. rate limits), 30-day window

Latency SLOs (tiered):
  Simple queries (classification/extraction): p95 < 2s
  Standard queries (RAG Q&A):                 p95 < 5s
  Complex queries (multi-step reasoning):     p95 < 15s
  Time to First Token (streaming):            p95 < 1s

Quality SLO: >85% user satisfaction (thumbs-up / not regenerated) +
             automated faithfulness scoring (RAGAS)

Retrieval SLO (RAG): >90% hit rate (relevant doc in top-5)

Cost SLO: <$0.05 average cost per query (token tracking + infra allocation)

34.5 Q&A

Q: How do you design SLOs for a Gen AI application? See 103.4 above — the key insight interviewers look for is recognizing that traditional availability/latency SLOs are necessary but insufficient; you must add quality and cost as first-class SLIs, and use automated eval (RAGAS, golden datasets) rather than manual QA to measure them continuously.

Q: Difference between SLO and SLA? SLO is an internal engineering target; SLA is an external contractual commitment with financial/legal consequences. SLAs are typically set looser than SLOs (e.g., internal SLO 99.95%, external SLA 99.9%) to give engineering margin before breaching the contract.