Field contextLesson 1 of 4
  1. SLOs and error budgets, not reconciled
    1. SLI, SLO and SLA
    2. Choosing SLIs
    3. Error budgets
    4. Burn-rate alerts
    5. Kubernetes inputs
    6. Reliability patterns
  2. Incident response and postmortems, not reconciled
  3. Multi-cluster and platform engineering, not reconciled
  4. Cost and capacity, not reconciled

SLOs and error budgets

An SLO turns "reliable enough" into a number, and the error budget it leaves decides when to ship and when to fix. Learn to write SLIs, compute budgets and alert on burn rate.

  • 16 min
  • 3 objectives
  • 6 scenes

Shows the lesson one block at a time. Arrow keys step, number keys jump to a scene, and Escape returns to the page where you were.

No service is 100% reliable, and trying to be costs more than users notice. Service level objectives replace “as reliable as possible” with a number both product and engineering agree on, and the gap between that number and perfection becomes a budget the team can spend on releases, experiments and risk.

Reconcile, in 6 scenes

SLI, SLO and SLA

An SLIService level indicator: a measurement of the service as users experience it, written as good events divided by valid events. is the measurement. An SLOService level objective: a target for an SLI over a time window, such as 99.9% of valid requests succeeding over 30 days. is the target. An SLA is a contract that attaches consequences, usually service credits, to missing a target; it is set looser than the internal SLO so the team gets warning before money changes hands.

Writing the SLI as a ratio of events keeps it comparable across services and traffic levels. “Valid” matters as much as “good”: a health check, a request rejected for a malformed body, or traffic from a load test are not what the objective is about, so they are left out of the denominator.

Choosing SLIs

Most user-facing services need two or three SLIs from a short list:

  • Availability: the proportion of valid requests that succeed (not a 5xx, not a timeout).
  • Latency: the proportion of valid requests faster than a threshold.
  • Freshness: the proportion of reads that return data updated within a threshold, for pipelines and caches.
  • Correctness: the proportion of outputs that are right, checked by probes with known answers.

Percentiles are not thresholds. The p99 describes the latency distribution and helps choose a threshold, but the SLI counts requests: “the share of checkout requests served in under 400 ms”. Several objectives can share one SLI with different thresholds, such as 90% under 100 ms and 99% under 400 ms. Count slow requests directly, with a histogram bucket boundary at the threshold, rather than estimating a percentile and comparing it.

Measure where users feel the service: at the load balancer or Gateway, or in the client, not from CPU or pod counts. An availability SLI over a Prometheus request counter looks like this:

sum(rate(http_requests_total{route="/checkout",code!~"5.."}[5m]))
/
sum(rate(http_requests_total{route="/checkout"}[5m]))

Error budgets

The error budgetOne minus the SLO, over the SLO’s window: the amount of unreliability the service may spend. for a 99.9% objective is 0.1% of valid events. Over 30 days (43,200 minutes) that works out to:

SLOBudgetFull outage it allows in 30 days
99%1%7.2 hours
99.5%0.5%3.6 hours
99.9%0.1%43.2 minutes
99.95%0.05%21.6 minutes
99.99%0.01%4.32 minutes

Each extra nine cuts the budget tenfold. At 99.99%, one slow rollback spends the month.

A budget only changes behaviour with a policy agreed before it is needed. The example policy in Google’s SRE workbook halts all changes except urgent fixes and security patches when the four-week budget is exhausted, and requires a postmortem with at least one top-priority action for any single incident that consumes more than 20% of it. The other side matters as much: a team with budget left can ship faster and take risks, because the number says users will not notice.

Burn-rate alerts

The burn rateHow fast a service spends its error budget relative to the SLO window: the observed error ratio divided by the budget ratio. A burn rate of 1 spends exactly the whole budget over the window. turns the budget into an alert. Against a 99.9% SLO, a 1.44% error ratio is a burn rate of 14.4, which spends 2% of a 30-day budget in one hour and the whole budget in about two days.

Thresholds such as “error rate above 1% for five minutes” page on harmless blips and stay silent through a slow leak that burns the budget over a week. The SRE workbook recommends pairing burn-rate thresholds with how much budget each spends:

Budget consumedLong windowShort windowBurn rateAction
2%1 hour5 minutes14.4Page
5%6 hours30 minutes6Page
10%3 days6 hours1Ticket

Each alert needs both windows over the threshold. The long window gives precision; the short one, 1/12 of the long, makes the alert reset shortly after the errors stop: about five minutes for the 1-hour alert, instead of most of an hour.

(
  job:slo_errors_per_request:ratio_rate1h{job="checkout"} > (14.4 * 0.001)
and
  job:slo_errors_per_request:ratio_rate5m{job="checkout"} > (14.4 * 0.001)
)

Kubernetes inputs

Kubernetes produces a lot of signals that feed SLIs or explain why one moved, without being SLIs themselves: Gateway and mesh request metrics, probe failures, container restarts and endpoint readiness. A restart that no user noticed spent no budget.

Endpoint readiness shows how many backends a Service can send traffic to. Read it from EndpointSlices (discovery.k8s.io/v1, stable since Kubernetes 1.21), listed by the kubernetes.io/service-name label, whose endpoints carry ready, serving and terminating conditions. The core v1 Endpoints API is deprecated in Kubernetes 1.33 and later: the API server warns on every use, it truncates at 1000 endpoints, and it has no dual-stack or traffic-distribution data.

Three ready replicas and one pod failing its readiness probe
kubectl get endpoints web
Warning: v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice
NAME   ENDPOINTS                                         AGE
web    10.244.3.2:8080,10.244.2.2:8080,10.244.1.3:8080   30s
kubectl get endpointslices -l kubernetes.io/service-name=web
NAME        ADDRESSTYPE   PORTS   ENDPOINTS                                      AGE
web-xs4dj   IPv4          8080    10.244.3.2,10.244.2.2,10.244.1.3 + 1 more...   30s
kubectl get endpointslices -l kubernetes.io/service-name=web -o jsonpath='{range .items[*].endpoints[*]}{.targetRef.name} ready={.conditions.ready}{"\n"}{end}'
web-549795f985-dq87d ready=true
web-549795f985-nshlv ready=true
web-549795f985-pggpj ready=true
web-canary ready=false

The unready pod is listed in the slice with ready=false and receives no traffic.

Meeting an availability SLO also depends on placement. Three replicas on one node share its fate, so spread them:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
spec:
  replicas: 3
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      topologySpreadConstraints:
      - maxSkew: 1
        topologyKey: kubernetes.io/hostname
        whenUnsatisfiable: DoNotSchedule
        labelSelector:
          matchLabels:
            app: web
        matchLabelKeys:
        - pod-template-hash
      containers:
      - name: web
        image: ghcr.io/kx-labs/web:1.1
        ports:
        - name: http
          containerPort: 8080
        readinessProbe:
          httpGet:
            path: /ready
            port: http

Reliability patterns

Patterns in the client decide how much of a dependency’s failure reaches users:

  • Timeouts on every remote call, shorter than the caller’s own deadline, so a slow dependency fails fast instead of holding threads.
  • Retries only for idempotent operations, with exponential backoff, jitter and a cap. Retries multiply load: three layers that each make up to three attempts turn one failing call into 27 at the bottom.
  • Circuit breakers stop calling a dependency after repeated failures and probe it again later. The breaker opens only on failures it sees, so record the failure before handing the call to a fallback; a fallback that catches every exception and returns a default hides the failures and the breaker never opens.
  • Graceful degradation: serve cached or partial results, or shed low-priority traffic, rather than failing the whole request.

Read endpoint readiness on your cluster

  1. kubectl --context kind-kx create deployment front --image=nginx:1.30 --replicas=3
  2. kubectl --context kind-kx expose deployment front --port=80
  3. kubectl --context kind-kx get endpointslices -l kubernetes.io/service-name=front
  4. kubectl --context kind-kx get endpoints front
  5. kubectl --context kind-kx delete service,deployment front

For your own kind cluster kx: copy a command and paste it into your terminal. Run in the simulator runs the same command in this page's simulated cluster instead; nothing on this page touches your machine. The EndpointSlice lists the three pod IPs; the Endpoints query prints a deprecation warning before the same addresses.

Actual state

Check your understanding

6 checks

Your first answer to each check is the one that counts. After a miss you can answer again; passing every check reconciles the lesson.

  1. Check 1 of 6

    A service has a 99.9% availability SLO over 30 days. How much complete downtime does its error budget allow?

  2. Check 2 of 6

    Against a 99.9% SLO, a service is failing 0.5% of requests. What is the burn rate, and how long would a 30-day budget last at that pace?

  3. Check 3 of 6

    Which is a well-formed latency SLI?

  4. Check 4 of 6

    A burn-rate alert fires when both the 1-hour and the 5-minute burn rates exceed 14.4. What does the 5-minute window add?

  5. Check 5 of 6

    A Deployment's topologySpreadConstraints entry sets maxSkew and topologyKey but no labelSelector. What does the scheduler do with it?

  6. Check 6 of 6

Lesson not yet reconciled

Desired: 3 objectives, 0 metReconciled: 3 of 3 objectives met

  • Write an SLI as good events over valid events and set an SLO on it. (not yet met)
  • Compute an error budget and a burn rate. (not yet met)
  • Alert on multi-window burn rates instead of raw thresholds. (not yet met)

Pass every check above to reconcile this lesson.

Every check has passed, so the desired state is met. First-try accuracy: 0 of 6. This lesson's review cards are in your queue.

Changed since the notes

This lesson draws on an earlier set of study notes. Where the documentation contradicts a claim in them, qualifies it or has moved past it, the claim is listed here with the corrected statement and the source it was checked against.

Show 5 corrections
  1. Stale, true once, no longerSLOs, SLIs, and Error Budgets

    The notes saidService endpoint availability measures whether the Kubernetes Service has healthy endpoints.

    CorrectedMeasure ready endpoints through EndpointSlices (discovery.k8s.io/v1, stable since 1.21; list by label kubernetes.io/service-name, use endpoints[].conditions.ready/serving). The core v1 Endpoints API is deprecated as of Kubernetes 1.33 (API server warns on use), truncates at 1000 endpoints, and lacks dual-stack and traffic-distribution data.

    Sourcekubernetes.io/blog/2025/04/24/endpoints-deprecation

  2. Nuance, true with conditionsSLOs, SLIs, and Error Budgets

    The notes saidPrometheus with Alertmanager is the common SLI stack; Istio provides proxy-level metrics.

    CorrectedPrometheus/Alertmanager remains common. Istio's metrics depend on data-plane mode: sidecar mode emits L4+L7 standard metrics from each Envoy; ambient mode (GA in Istio 1.24) emits only L4 TCP metrics from ztunnel (reporter="source") and needs a waypoint proxy for HTTP/L7 metrics (reporter="waypoint"). Dashboards filtering on reporter=destination/source sidecar semantics need updating for ambient.

    Sourceistio.io/latest/blog/2024/ambient-reaches-ga/%20;%20https://istio.io/latest/docs/ambient/architecture/data-plane

  3. Wrong, not trueSLOs, SLIs, and Error Budgets

    The notes saidLatency SLI uses 'multiple thresholds - 50th, 95th, 99th percentile'.

    CorrectedPercentiles are distribution statistics, not thresholds. A latency SLI is the proportion of requests faster than a threshold (for example 'share of requests under 400 ms'); multiple SLO targets pair a threshold with a target proportion (90% < 100 ms, 99% < 400 ms). Percentiles are a way to observe the distribution and choose thresholds; counting slow requests directly is preferred over approximating from histograms.

    Sourcesre.google/workbook/implementing-slos

  4. Wrong, not trueBuilding Reliable Systems

    The notes saidtopologySpreadConstraints without labelSelector

    CorrectedA nil selector matches nothing, so the constraint counts no pods. Add labelSelector, and matchLabelKeys if needed.

    Sourcekubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints

  5. Wrong, not trueBuilding Reliable Systems

    The notes saidCircuit breaker that catches all exceptions

    CorrectedIf the fallback swallows exceptions, the breaker never records failures and never opens. Record the failure before falling back.

    Sourcemartinfowler.com/bliki/CircuitBreaker.html

Every correction across the guide, by note and topic.

Sources

Checked against kubernetes.io and the Google SRE books for Kubernetes 1.37 on .

  1. sre.google/sre-book/service-level-objectives
  2. sre.google/workbook/implementing-slos
  3. sre.google/workbook/alerting-on-slos
  4. sre.google/workbook/error-budget-policy
  5. kubernetes.io/docs/concepts/services-networking/endpoint-slices
  6. kubernetes.io/blog/2025/04/24/endpoints-deprecation
  7. kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints

SLOs and error budgets

↓ ↑ step, 1 to 6 scene, Esc leave

kind cluster kxLast command: Nothing run yet