SLOs and Error Budgets for Kubernetes Workloads

SLOs and Error Budgets for Kubernetes Workloads

A complete, plain-English guide to turning "is it reliable enough?" into numbers you can measure, alert on and use to decide when to ship fast and when to slow down — with every idea mapped to how real Kubernetes clusters behave.

Imagine you own a small bakery. Every morning customers ask a simple question: “Will my bread be ready on time?” You could answer “we try our best,” but that tells nobody anything. A better answer is a promise you can check: “Nineteen days out of twenty, your order will be ready within ten minutes of the time we quote.” Now everyone knows what to expect, you know when you are failing, and you can decide calmly whether to buy a second oven or try a new recipe.

Running software on Kubernetes is the same story at a much larger scale. Pods restart, nodes disappear, deployments roll out, and traffic jumps without warning. In the middle of all this movement, teams still need a clear, shared answer to “is our service reliable enough?” Service Level Objectives, or SLOs, and their companion idea, the error budget, are that answer. In this guide you will learn what they are, how to choose and measure them for workloads on Kubernetes, how to alert on them without drowning in noise, and how to use the leftover budget to balance speed against stability.

1Why Reliability Needs Numbers

“Make it more reliable” is a wish. “Keep ninety-nine point nine percent of requests successful” is a plan.

The trouble with feelings

Without numbers, reliability becomes an argument. The product manager says the service feels slow, the engineer says it looks fine in the dashboard, and the on-call person says they have not slept in three days. Everyone is describing a different slice of the same reality, and nobody can say who is right. Decisions get made by whoever speaks loudest or was woken most recently.

Numbers change the conversation. When a team agrees in advance what “good enough” means, and measures it the same way every day, debates turn into questions with answers. Did we meet the target this month? How much room do we have left? Is this incident serious or just noisy? Those questions can be answered from data, not from mood.

Simple Analogy

Think of a school report card. Without grades, a parent hears “your child is doing okay,” which could mean anything. With grades, the parent sees clearly where things are strong, where they are slipping, and how much effort is needed to reach the next level. An SLO is the grading scale for your service, and the error budget is the number of mistakes allowed before the grade drops.

Why 100 percent is the wrong target

It is tempting to aim for perfection. But perfection is impossible, and chasing it is extremely expensive. Every extra “nine” of reliability costs far more than the last, because you must remove ever-rarer failures, add redundancy and slow down changes. There is also a point beyond which your users cannot tell the difference: if their phone connection fails once in a hundred requests, making your service fail once in a million adds no real value to them.

The wise approach is to choose a target that is high enough that users are happy and low enough that you can still change the system. The gap between that target and perfection is the error budget: the amount of unreliability you are allowed to spend on deployments, experiments and the ordinary accidents of running software.

1
shared number that product, engineering and operations all agree on
100%
is never the goal; the gap below the target is your budget
0
arguments needed once the budget is measured the same way by everyone
!
Common Misconception

“An SLO is just a fancy name for uptime.” Uptime asks whether a machine was running. An SLO asks whether users were served well. A pod can be up and ready while returning errors or taking ten seconds to answer, and that is exactly the kind of failure an SLO is designed to catch.

A story of two teams

Team A: no targets

Team A runs an ordering service on Kubernetes. Every outage leads to a freeze on new releases “until things calm down,” and every complaint leads to new rules. Nobody knows when the freeze should end, so it drags on, morale drops, and the business grows frustrated at the slow pace.

Team B: clear targets and a budget

Team B agreed on a target with its product owner and measured it continuously. When the budget is healthy, they release freely. When it runs low, they slow down and fix reliability. The rule is written down, so nobody argues, and both speed and stability improve.

“An error budget turns reliability from a fear into a currency you can plan with.”

2The Vocabulary: SLI, SLO, SLA, Error Budget and Burn Rate

Five short terms carry the whole idea. Learn them once and the rest of this guide will feel natural.

Term 1

SLI — Service Level Indicator

A measurement of how well the service is doing, usually the proportion of good events out of all valid events, such as the share of requests that succeeded.

Term 2

SLO — Service Level Objective

The target for an SLI over a time window, such as “99.9 percent of requests succeed over a rolling twenty-eight days.”

Term 3

SLA — Service Level Agreement

A contract with customers that promises a level of service and states consequences, often refunds, if it is missed. It is usually looser than the internal SLO.

Term 4

Error budget

The amount of failure the SLO allows. If the target is 99.9 percent, the budget is the remaining 0.1 percent of events or time.

Term 5

Burn rate

How fast the budget is being used compared with the pace that would exactly use it up by the end of the window. A burn rate of one is the “just right” pace.

Term 6

Error budget policy

The written agreement on what the team does when the budget is healthy, low or gone, such as slowing releases or prioritising reliability work.

Simple Analogy

Think of a monthly phone data plan. The SLI is the amount of data you have used. The SLO is the plan limit you decided to stay within. The error budget is the data you have left. The burn rate is how quickly you are eating through it: if you finish half the data in the first three days, you are burning too fast. The SLA is the contract with the phone company that says what happens if they fail to deliver.

How the terms fit together

TermAnswers the questionWho cares mostExample
SLIHow are we doing right now?Engineers and on-callShare of checkout requests that succeed in under half a second
SLOHow good must it be?Product and engineering together99.9 percent over twenty-eight days
Error budgetHow much failure can we afford?Release managers and team leadsAbout forty minutes of full failure per month
Burn rateHow fast are we spending it?On-call engineersCurrently burning ten times faster than allowed
SLAWhat do we owe customers?Business and legal teamsService credits if monthly availability drops below 99.5 percent

Why the SLO is stricter than the SLA

A sensible team keeps its internal SLO tighter than the promise it makes to customers. The gap gives early warning: you will notice trouble and fix it while you are still inside the contract. If the SLO and the SLA are the same number, the first alarm you receive will already be a breach, with money or reputation attached.

i
Not Every Service Needs an SLA

Most internal services need only SLIs and SLOs. An SLA is a business and legal commitment, and it should be created deliberately for paying customers, not copied by default from an SLO.

3Why Kubernetes Changes the SLO Conversation

Kubernetes gives you powerful self-healing, and it also adds new layers where things can go wrong without any user noticing at first.

Many layers between the user and your code

A request from a customer passes through several layers before reaching your application and several more on the way back. There is the user’s network, a cloud load balancer, an ingress controller or gateway, possibly a service mesh, the Kubernetes service that spreads traffic, the pod itself, and then the dependencies your application calls. A failure in any layer looks the same to the user: the page did not load.

flowchart TD
    A["User or client"] --> B["Cloud load balancer"]
    B --> C["Ingress or gateway"]
    C --> D["Service mesh sidecars"]
    D --> E["Kubernetes service routing"]
    E --> F["Application pods"]
    F --> G["Databases, caches and other services"]
    F -.-> H["Nodes, network and storage underneath"]
        
FIG 1 — The layers between a user and a workload on Kubernetes

Reading the diagram from top to bottom shows why SLOs must be measured from the user’s point of view. A dashboard that only watches pods can show everything green while an overloaded ingress drops requests before they ever arrive. The SLO belongs to the experience, not to any single component.

Simple Analogy

Think of a package delivery. The warehouse can run perfectly, yet the customer receives nothing if the truck breaks down or the address is wrong. The customer judges the whole journey, not just the warehouse. Your SLO judges the whole request journey, not just your pods.

What Kubernetes gives you

Helps

Self-healing

Failed containers are restarted and missing pods are replaced automatically, which hides many small failures from users.

Helps

Replication

Several copies of a workload mean one failing pod does not take the whole service down.

Helps

Rolling updates

New versions can be introduced gradually, with the chance to stop if things go wrong.

Helps

Autoscaling

Capacity can follow demand, reducing overload during busy periods.

What Kubernetes adds to worry about

Risk

Constant change

Pods are created and destroyed all the time, so every deployment, scale event or node replacement is a chance for brief errors.

Risk

Hidden shared infrastructure

Nodes, networking and DNS are shared by many workloads, so a neighbour’s problem can become yours.

Risk

Misleading health signals

A pod reported as running or ready may still be serving errors or answering slowly.

Risk

Many moving dependencies

Microservices multiply the number of calls per user request, and each call is another place to fail.

Three levels where SLOs live

LevelWho owns itTypical SLO
User-facing serviceApplication teamShare of successful, fast requests for a user journey such as checkout
Internal serviceApplication or platform teamSuccess and latency of calls between services, treated as a promise to other teams
PlatformPlatform teamCluster services such as scheduling speed, DNS answers, ingress availability and API server responsiveness
i
Start at the Top

Begin with user-facing SLOs. They tell you what actually matters. Internal and platform SLOs can then be derived from what the user-facing ones require of them.

4Choosing What to Measure: User Journeys and SLI Types

The best SLI is the one that moves when your users are unhappy and stays still when they are not.

Start from what users do

Before choosing any metric, list the few things users actually do with your service. For an online shop it might be browsing products, adding to the basket and paying. For a messaging app it might be sending and receiving messages. These are user journeys, and each deserves its own SLO, because a failure on the payment journey matters far more than a slow loading of a rarely used settings page.

The common families of SLIs

Family

Availability

The share of requests that succeed. The most common starting point, measured as successful responses divided by valid requests.

Family

Latency

The share of requests answered faster than a threshold, such as under three hundred milliseconds. Slow can be as bad as broken.

Family

Quality

The share of responses that are complete and not degraded, for instance results that were not served from a fallback because a dependency was down.

Family

Freshness

How up to date the data is, such as the share of records updated within five minutes. Vital for dashboards and data pipelines.

Family

Throughput

The rate at which work is processed, such as messages handled per second, important for queues and streaming systems.

Family

Durability and correctness

The likelihood that stored data is not lost, and that answers are right. Critical for databases and anything involving money.

Simple Analogy

Think of a restaurant. Availability is whether a table was ready when you arrived. Latency is how long the food took. Quality is whether the dish was what you ordered. Freshness is whether the ingredients were fresh. A restaurant could do well on one of these and fail on another, which is why you pick the ones your guests care about.

Matching SLI types to workloads

Workload typePrimary SLIsSecondary SLIs
Web frontends and APIsAvailability and latency of requestsQuality of responses, such as non-degraded results
Databases and cachesAvailability and latency of queriesDurability, replication lag, restore time
Message queues and streamsDelivery success and end-to-end delayConsumer lag, throughput
Batch jobs and scheduled jobsSuccess rate of runs and on-time completionFreshness of the output data
Data pipelinesFreshness and correctnessCompleteness, throughput
Platform services such as DNS and ingressAvailability and latencyError rates, saturation

Prefer a few strong SLIs

A common mistake is to define dozens of indicators for every service. That produces dashboards that nobody reads and alerts that nobody trusts. A better rule is to pick one or two SLIs per user journey, usually availability and latency, and add others only when users clearly suffer in ways those two miss.

!
CPU Is Not a User Experience

High CPU, high memory and many restarts are signals about causes, not about user pain. A pod can restart ten times a day and no user may notice, while a calm-looking cluster may be failing a payment flow. Keep cause metrics for diagnosis, and base your SLOs on what users receive.

Example: an online bookshop

The team lists three journeys: search, add to basket and checkout. Each gets an availability SLI and a latency SLI. Checkout also gets a correctness SLI that counts orders recorded without payment errors. They deliberately skip SLIs for admin pages, because failures there do not hurt customers.

5Writing a Good SLI: Good Events Over Valid Events

A simple ratio, carefully defined, is the foundation of everything else in this guide.

The universal formula

Almost every useful SLI can be written the same way: the number of good events divided by the number of valid events, expressed as a percentage. A good event is one the user would call a success, such as a request that returned a correct response quickly. A valid event is one that counts at all, which excludes things you do not want to hold the service responsible for, such as requests the user got wrong.

This shape has a lovely property. It always sits between zero and one hundred percent, it works for requests, jobs and records alike, and it makes the error budget a simple subtraction. Any measurement that can be turned into this ratio can become an SLI.

Simple Analogy

Think of a basketball player’s shooting record. Good events are baskets scored. Valid events are shots attempted in a real game. Practice shots do not count, and neither do accidental tosses. The record is baskets divided by valid attempts, and it is easy to compare from month to month.

Deciding what counts as good and valid

1

Define the event

Decide what one unit of work is: a request, a job run, a record, a message. Be specific, because “the service” is not an event.

2

Define valid

Remove events that are not the service’s fault or are not real traffic, such as health checks, requests from your own test tools, and malformed requests rejected as client errors.

3

Define good

State what makes a valid event a success: a successful response code, a response within the latency threshold, a complete result.

4

Pick the measuring point

Decide where the event is counted. The closer to the user, the more honest the result.

5

Write it down

Document the definition in plain language so that anyone can understand exactly what the number means.

Where to measure: the closer to the user, the better

Measuring pointWhat it catchesWhat it misses
Real user or client sideEverything the user experiences, including network and browser problemsHard to collect and noisy, since it includes the user’s own connection
Cloud load balancer or edgeAlmost everything that reaches your infrastructureFailures inside the user’s network before the edge
Ingress controller or gatewayFailures between the edge and your cluster servicesRequests that never reached the cluster
Service mesh or sidecarService-to-service call success and latencyFailures before the mesh, and calls that bypass it
Application metricsBusiness-level correctness and detailed reasons for failureRequests that fail before reaching the application code
Synthetic probesAvailability of key journeys even when traffic is low or zeroReal-world variety of requests and devices
i
A Practical Default

For most Kubernetes web workloads, measure at the ingress or load balancer as the main SLI, add application metrics for correctness, and use synthetic probes for low-traffic journeys. This mix is cheap to collect and close to what users feel.

Traps that make an SLI lie

Trap

Counting only server-side success

Requests dropped before they reach the server are invisible, so the SLI looks perfect during outages that users feel strongly.

Trap

Treating all errors alike

A wrong password is not a service failure, while a server error is. Separate them carefully when defining valid and good.

Trap

Health checks inflating traffic

Frequent probes are easy, always successful requests that make the ratio look better than reality. Exclude them.

Trap

Averaging latency

An average hides the slow tail that real users suffer. Use thresholds and percentiles instead.

Example: a payment API

The team defines the event as one payment request received at the gateway. Valid events exclude health checks and requests rejected for bad input. Good events are valid requests that return a success response in under eight hundred milliseconds. The SLI is good divided by valid, measured per minute and combined over twenty-eight days.

6Setting the SLO Target: Nines, Windows and Honest Ambition

Choosing the number is as much about people and money as it is about technology.

Reading the nines

Reliability targets are often described by the number of nines: ninety-nine percent is two nines, ninety-nine point nine is three nines, and so on. Each extra nine cuts the allowed failure by a factor of ten, and it also makes the engineering far more demanding. The table below shows how much full outage each target allows over a rolling twenty-eight-day window.

SLO targetAllowed failureEquivalent full outage in 28 daysFeels like
99%1 in 100About 6 hours 43 minutesFine for internal tools and non-urgent batch work
99.5%1 in 200About 3 hours 22 minutesReasonable for many business applications
99.9%1 in 1,000About 40 minutesA common target for customer-facing services
99.95%1 in 2,000About 20 minutesDemanding; needs strong automation and redundancy
99.99%1 in 10,000About 4 minutesVery hard; often needs multi-region design and heavy investment
99.999%1 in 100,000About 24 secondsRarely realistic for a single service; reserved for critical infrastructure
40 min
of full failure allowed per 28 days at three nines
4 min
allowed at four nines, which a single slow rollout can consume
24 sec
allowed at five nines, shorter than most pod restarts
Simple Analogy

Think of a marathon runner shaving time off a personal best. Going from five hours to four is achievable with good training. Going from three hours to two hours fifty-nine is possible only with extraordinary effort. Each extra nine of reliability is like that last stretch: the closer you get to perfect, the more every single second costs.

How to pick a target

1

Look at what you achieve today

Measure the SLI for a few weeks without a target. Your current performance is a reality check, and a first target slightly below it is easy to defend.

2

Ask what users really need

Talk to product owners and look at complaint data. Find the point where more reliability stops changing user behaviour.

3

Check your dependencies

You cannot be more reliable than the things you depend on, unless you add fallbacks. A target above your database’s reliability is a hope, not a plan.

4

Count the cost

Estimate what each extra nine would cost in engineering time, infrastructure and slower releases, and compare it with the benefit.

5

Start modest and tighten later

A target you can meet is far more useful than an ambitious one you always miss. You can raise the bar once the process is working.

Choosing the window

An SLO is measured over a time window, and the choice matters. A rolling window, such as the last twenty-eight days, moves forward continuously, so a bad day slowly leaves the record instead of vanishing at midnight on the first of the month. A calendar window resets on a fixed date, which matches how business reporting works but creates odd behaviour: a disaster on the thirtieth leaves almost no consequences, while one on the second hangs over the team for weeks.

Many teams prefer rolling windows of twenty-eight days, because that contains exactly four weeks and therefore the same number of weekends and weekdays every time. This avoids false changes in the numbers caused purely by the calendar.

Rolling window

  • Smooth behaviour with no sudden resets
  • Every bad event matters for the full window length
  • Matches continuous alerting naturally
  • Same mix of weekdays and weekends when set to multiples of seven days

Calendar window

  • Matches monthly business and contract reports
  • Budget resets can encourage risky behaviour at the start of a period
  • Late-period incidents seem less serious than early-period ones
  • Months have different lengths, making comparisons harder
!
Do Not Copy a Target

Choosing 99.99 percent because a famous company has it is a recipe for frustration. Their architecture, budget and user expectations are not yours. Choose a target that fits your users and your capacity to deliver.

7Error Budget Arithmetic, Step by Step

The budget is only one subtraction away from the SLO, but doing it carefully makes every later decision easier.

Two ways to count the budget

The error budget can be stated in time or in events. The time version says how long the service may be completely broken, which is easy to talk about but only exact for simple on-or-off failures. The event version says how many requests, or jobs, may fail, which handles partial failures properly, because a problem that fails half the requests for ten minutes spends only half as much budget as total failure for ten minutes.

StyleHow it is statedBest forWeakness
Time-basedMinutes of allowed full outage in the windowExplaining to non-technical peoplePoor at handling partial failures
Event-basedNumber of allowed failed requests or jobs in the windowAccurate tracking and alertingHarder to picture without a conversion to time

A worked example in words

The setting

A checkout API receives about ten million requests per day. The SLO is ninety-nine point nine percent success over a rolling twenty-eight days. Over the window that is about two hundred eighty million requests.

The budget

The allowed failure is one thousandth of the requests, which is two hundred eighty thousand failed requests across the window. That is the whole budget.

The incident

A bad deployment causes half of all checkout requests to fail for twenty minutes. At roughly seven thousand requests per minute, that is about sixty-nine thousand failed requests. This one incident has spent about a quarter of the entire month’s budget.

The lesson

A single twenty-minute problem, even a partial one, consumed twenty-five percent of the budget. The team can afford about three more incidents of that size before the budget runs out, which shapes how cautiously they should ship until the old incident ages out of the window.

Simple Analogy

Imagine a bank account that receives a fixed allowance each month and cannot go below zero without consequences. A big unexpected bill, such as an incident, takes a chunk out of the account. A fast spender is easy to spot because the balance drops quickly. An error budget is a reliability bank account: every failure is a withdrawal, and the account is topped up gradually as old withdrawals leave the window.

Keeping the books

1

Compute the total allowed failures

Multiply the number of valid events in the window by one minus the SLO target.

2

Count the actual failures so far

Take the number of bad events within the same window, from your measuring point.

3

Compute the remaining budget

Subtract actual failures from the allowed total and express the result as a percentage of the whole budget.

4

Show it where everyone can see

Display the remaining budget on a team dashboard and in release tools. A number nobody looks at changes nothing.

i
The Budget Can Go Negative

If failures exceed the allowance, the remaining budget is below zero, meaning the SLO is breached for that window. Many dashboards show this as a clear red number. A negative budget is information, not shame, and it should trigger the agreed policy.

8Burn Rate: How Fast Are We Spending?

The remaining budget tells you where you stand. The burn rate tells you how quickly things are changing.

The definition in plain words

Burn rate is the current rate of errors divided by the error rate that the SLO allows. If the target allows one failure in a thousand and right now one request in a thousand is failing, the burn rate is one: you are spending the budget at exactly the pace that finishes it at the end of the window. If ten in a thousand are failing, the burn rate is ten, and the budget will be gone in a tenth of the window.

Simple Analogy

Think of the fuel gauge and the fuel consumption display in a car. The gauge shows how much fuel is left, like the remaining budget. The consumption display shows how fast you are using it right now, like the burn rate. A car with half a tank is fine if you are cruising gently, and in trouble if you are racing up a mountain with the engine screaming.

How burn rate translates into time

Burn rateMeaningTime to use the whole 28-day budget
1Spending exactly on pace28 days
2Twice as fast as allowed14 days
6A serious but slow-moving problemAbout 4 days 16 hours
14.4A fast problem that needs quick attentionAbout 47 hours
100A severe outageAbout 6 hours 43 minutes
1000Nearly total failure at a three-nines targetAbout 40 minutes

Why this matters more than the raw error rate

A raw error rate of one percent means different things for different services. For a service with a ninety-nine percent target it is exactly on pace, so it is not an emergency. For a service with a ninety-nine point nine percent target it is a burn rate of ten, a serious problem. Burn rate normalises errors against what each service can afford, so the same alerting rule works across services with different targets.

Example: the same one percent

Two services both see one percent of requests failing. The internal reporting tool has a ninety-nine percent target, so its burn rate is one and it can stay that way all month. The payment API has a ninety-nine point nine percent target, so its burn rate is ten and the whole month’s budget will be gone in under three days. The same error rate is boring in one place and urgent in the other.

!
Watch the Duration, Not Just the Rate

A short spike with a huge burn rate may cost little budget, while a long, quiet leak at a small burn rate can cost a lot. Good alerting considers both how fast the budget is draining and for how long it has been draining.

9Alerting on SLOs Without Drowning in Noise

An alert should wake someone only when users are really being hurt and a human can really help.

Why simple alerts fail

The traditional approach is to alert when the error rate goes above a threshold for a few minutes. It has two problems. A short spike triggers a page even though it costs almost no budget, which trains people to ignore alerts. And a slow leak just under the threshold never triggers anything, yet quietly drains the whole budget over weeks. Neither behaviour matches what you actually care about, which is whether the SLO is in danger.

ApproachStrengthWeakness
Error rate above a fixed thresholdSimple to set upNoisy for blips and blind to slow leaks
Alert when the budget is nearly goneFew alerts, direct tie to the SLOWarns far too late to act
Burn rate over one windowTied to budget, adjustableSlow to reset and a trade-off between speed and noise
Burn rate over multiple windows and levelsFast for big problems, patient for slow ones, quick to clearMore rules to build, though tools generate them

Multiple windows and multiple burn rates

The recommended pattern combines several alerts. Each alert watches a burn rate over a long window and over a short window at the same time, and fires only when both exceed the same threshold. The long window shows that the problem is real and significant. The short window shows that it is still happening right now, so the alert clears soon after recovery instead of staying red for hours.

SeverityBurn rateLong windowShort windowBudget used when it fires
Page, urgent14.41 hour5 minutesAbout 2 percent
Page, serious66 hours30 minutesAbout 5 percent
Ticket, slow leak13 days6 hoursAbout 10 percent
flowchart TD
    A["Measure burn rate over several windows"] --> B{"Burn rate above 14.4 over 1 hour and 5 minutes?"}
    B -->|"Yes"| C["Page the on-call engineer now"]
    B -->|"No"| D{"Burn rate above 6 over 6 hours and 30 minutes?"}
    D -->|"Yes"| E["Page the on-call engineer"]
    D -->|"No"| F{"Burn rate above 1 over 3 days and 6 hours?"}
    F -->|"Yes"| G["Open a ticket for working hours"]
    F -->|"No"| H["No alert"]
        
FIG 2 — A multi-window, multi-burn-rate alerting ladder

The ladder reads from the most urgent condition to the least. A sudden severe outage trips the first rule within minutes. A moderate problem trips the second after a few hours. A slow, quiet leak trips the third as a ticket, giving the team time to fix it in working hours without waking anyone.

Simple Analogy

Think of a smoke alarm system with different levels. A loud siren sounds for roaring flames, a gentle beep warns of a low battery, and a monthly reminder tells you to test the system. You would not want the same alarm for all three, and you would not want a siren for a burnt piece of toast.

Rules that keep alerts healthy

Rule

Alert on symptoms, not causes

Page for budget burn that users feel, not for high CPU or a single pod restarting. Causes belong on dashboards for diagnosis.

Rule

Every page needs an action

If a person cannot do anything useful, make it a ticket or remove it. Pages should be rare and meaningful.

Rule

Link a runbook

Each alert should point to a short guide on where to look first and what to try, so a tired engineer does not start from nothing.

Rule

Review noisy alerts monthly

An alert that fires often and leads to no action should be tuned or deleted. Alert fatigue is a reliability risk of its own.

i
Low-Traffic Services Need Care

When a service handles very few requests, a single failure can cause an enormous burn rate. Use longer windows, add synthetic probes to create steady traffic, or require a minimum number of events before an alert can fire.

10Collecting SLI Data in a Kubernetes Cluster

The good news is that a typical cluster already produces most of the raw material you need.

Where the numbers come from

Source

Ingress or gateway metrics

Request counts by status code and latency histograms at the edge of the cluster. The most common source for availability and latency SLIs.

Source

Service mesh metrics

Per-service request counts, response codes and durations for calls between services, without changing application code.

Source

Application metrics

Counters and histograms exposed by your own code, including business-level success such as orders completed correctly.

Source

Kubernetes state metrics

Information about deployments, pods, jobs and nodes, such as ready replicas, restarts and job completions. Useful for batch SLIs and diagnosis.

Source

Container resource metrics

CPU, memory and throttling per container. Mostly cause signals that help explain SLI problems.

Source

Synthetic probes

Scheduled test requests that exercise key journeys from outside the cluster, even when real traffic is low or zero.

flowchart LR
    A["Ingress, mesh and application metrics"] --> D["Metrics store"]
    B["Kubernetes state and resource metrics"] --> D
    C["Synthetic probes"] --> D
    D --> E["Recording rules compute SLIs per service"]
    E --> F["SLO and budget calculations"]
    F --> G["Dashboards"]
    F --> H["Burn rate alerts"]
        
FIG 3 — From raw metrics to SLO dashboards and alerts

Raw metrics are collected in one place, and rules compute the SLI for each service as a ratio of good to valid events. Those ratios then feed budget calculations that power both human-friendly dashboards and automated alerts. Keeping one pipeline for everything means the dashboard and the alert can never disagree.

Practical points that save pain

1

Aggregate by service, not by pod

Pods come and go all the time. SLIs must be summed across all pods of a service, so that a pod restart does not break a time series or make history disappear.

2

Use counters and rates

Request and error counters survive pod restarts when the metrics system handles counter resets correctly. Compute ratios from rates, not from raw totals.

3

Precompute with recording rules

Calculating a twenty-eight-day ratio from raw data on every dashboard view is slow and expensive. Precompute shorter windows and combine them.

4

Control label cardinality

Labels with many values, such as user identifiers or full URLs, can overwhelm the metrics store. Keep labels to a small, meaningful set like service, route group and status class.

5

Make monitoring itself reliable

If the metrics system is down, the SLI has a gap, and gaps hide real problems. Monitor the monitor, and decide in advance how to treat missing data.

Simple Analogy

Think of a school that records attendance on loose paper in each classroom. If every teacher uses their own format, the principal cannot compare classes. A single central register with the same columns for everyone lets the principal see the whole school at a glance. Recording rules are that common register for your services.

!
Missing Data Is Not Good Data

A service that crashes completely may stop reporting metrics, and a naive ratio over no data can look perfect or show nothing at all. Pair request-based SLIs with synthetic probes so that a silent failure still shows up as lost availability.

11Latency SLIs, Histograms and the Slow Tail

A service that answers correctly after thirty seconds has, for most users, failed.

Why averages lie

Imagine a service where ninety-nine requests take one tenth of a second and one request takes ten seconds. The average is about two tenths of a second, which sounds wonderful. Yet one user in a hundred waited ten seconds, and if that user is performing a payment, they may leave forever. Averages smooth away exactly the experiences that cause complaints. Latency SLIs should look at the slow tail, not the middle.

Simple Analogy

Think of a bus company that boasts “our buses are on time on average.” If half the buses arrive ten minutes early and half arrive ten minutes late, the average is perfect while every passenger is unhappy. A better promise is “ninety-five out of a hundred buses arrive within two minutes of the timetable,” which describes real experiences.

The threshold-based latency SLI

The cleanest way to define a latency SLI is to use the same good-over-valid ratio as everywhere else. Choose a threshold, such as three hundred milliseconds, and count the valid requests answered faster than that. The SLI is the share of requests under the threshold. An SLO then says, for example, that ninety-five percent of requests must be under three hundred milliseconds and ninety-nine percent under one second.

Using two or three thresholds paints a better picture than one. The first describes the typical experience, the second protects against the slow tail, and together they stop teams from improving the average while quietly worsening the worst cases.

How histograms make this possible

Metrics systems usually record latency in histograms: a set of buckets that count how many requests took less than certain amounts of time. If a bucket boundary lines up exactly with your SLO threshold, the count in that bucket divided by the total count is the SLI directly, with no approximation. If the threshold falls between bucket boundaries, the result is an estimate, and the error depends on how wide the buckets are.

Tip

Align buckets with thresholds

Choose bucket boundaries at the exact latency values your SLOs mention, so the SLI is exact instead of estimated.

Tip

Prefer ratios over percentile series

Percentiles computed per pod cannot be averaged correctly. Add up bucket counts across pods first, then compute the ratio.

Tip

Include timeouts as slow or failed

Requests that time out must count as bad, even if they never produced a recorded duration.

Tip

Separate fast and slow journeys

A report that normally takes a minute should not share a latency SLO with a login that should take half a second.

!
Averaging Percentiles Is a Classic Bug

Taking the average of each pod’s ninety-fifth percentile does not give the service’s ninety-fifth percentile. The math does not work that way. Always combine raw bucket counts across pods before computing anything.

Example: a search API

The team sets two latency objectives. Ninety percent of searches must finish within two hundred milliseconds, and ninety-nine percent within one second. They configure histogram buckets at exactly those two values. A deployment that adds a slow database call pushes the second ratio down while the average barely moves, and the burn rate alert catches it within the hour.

12Playbook: Stateless Web Services and APIs

The most common Kubernetes workload is also the easiest place to start with SLOs.

Stateless services handle requests, keep no important data in the pod, and can run as many identical copies as needed. They fit SLOs naturally, because requests are discrete events that are easy to count. They also benefit most from Kubernetes features such as replication, rolling updates and autoscaling.

A starter set of SLOs

SLIGood eventValid eventSample target
AvailabilityRequest answered without a server errorReal user requests, excluding health checks and client mistakes99.9% over 28 days
Latency, typicalRequest answered within the fast thresholdSame valid requests95% under 300 milliseconds
Latency, tailRequest answered within the slow thresholdSame valid requests99% under 1 second
QualityResponse built from full data, not a fallbackRequests that could use fallbacks99.5% over 28 days

The usual enemies of stateless SLOs on Kubernetes

Enemy

Rollout errors

Traffic reaching pods that are starting or shutting down causes short bursts of failed requests with every release.

Enemy

Cold starts and scale lag

New pods need time to start, warm caches and pass readiness, so a sudden surge can overwhelm the pods already running.

Enemy

Dependency failures

When a database or another service slows down, requests pile up and time out, often with little warning in pod-level metrics.

Enemy

Node and zone problems

A failing node or availability zone removes many pods at once, especially when they were packed together.

Simple Analogy

Think of a restaurant with several identical waiters. Customers do not care which waiter serves them, as long as someone does. The risks are a waiter walking away mid-order, a new waiter who has not learned the menu, or the kitchen running out of an ingredient. Those correspond to rollouts, cold starts and dependency failures.

Example: a product catalogue API

A catalogue API runs six replicas across three zones. The team sets a ninety-nine point nine percent availability SLO and a ninety-five percent under three hundred milliseconds latency SLO. They measure both at the ingress. Their biggest budget losses turn out to be brief error bursts during rollouts, so they invest in graceful shutdown, which recovers most of the lost budget.

i
Find the Top Budget Spender First

After a few weeks of measuring, list which causes consumed the most budget. Often one or two causes, such as rollouts or a single flaky dependency, account for most of it. Fixing those gives the biggest reliability return for the least work.

13Playbook: Stateful Systems, Batch Jobs and Streaming

Not everything on Kubernetes answers requests. Different workloads need different promises.

Databases and other stateful services

Databases hold data that cannot be recreated by starting a new copy, so their SLOs must include more than request success. Availability and latency of queries still matter, but durability, replication health and recovery time matter just as much. A database that answers quickly but loses data has failed in the worst possible way.

SLI

Query availability and latency

The share of queries that succeed and finish within thresholds, measured from the application’s point of view.

SLI

Replication lag

The share of time that replicas are within an acceptable distance of the primary, protecting against data loss on failover.

SLI

Backup success and restore time

The share of backups that complete and are verified by test restores, and how long a restore really takes.

SLI

Recovery objectives

The maximum acceptable data loss and recovery time, tested regularly rather than assumed.

Batch jobs and scheduled jobs

For a job that runs once a night, counting requests makes no sense. The better question is whether the work finished correctly and on time. Two SLIs cover most needs: the share of runs that complete successfully, and the freshness of the output, measured as the time since the last successful run. A freshness SLO such as “the report is never more than twenty-six hours old” protects the people who rely on the data, regardless of which individual run failed.

Simple Analogy

Think of a newspaper. Readers do not count each article as a request. They care that the paper arrives every morning, is complete and has today’s news. Success rate is whether the paper was printed correctly. Freshness is whether it is today’s edition and not yesterday’s.

Streaming and queue-based systems

Systems that move messages between services care about delay and loss. The key SLIs are the share of messages processed within a time limit, which is end-to-end freshness, and the share delivered without loss or duplication. Consumer lag, meaning how far behind the readers are, is a useful signal, but the SLO should be about the delay a user would feel, not the raw size of the backlog.

WorkloadGood eventValid eventSample SLO
Nightly report jobRun completed successfullyScheduled run99% of runs succeed over 28 days
Report freshnessTime sampled when the latest result is under 26 hours oldAll time samples99.5% of the time
Order event streamMessage processed within 30 secondsMessages published99% processed within 30 seconds
Database backupsBackup completed and restore test passedScheduled backups100% of weekly restore tests pass
!
A Green Pod Does Not Mean a Healthy Job

A scheduled job whose pods complete with exit status zero may still produce empty or wrong output. Combine the pod’s success with a check on the result, such as record counts or a data quality test, before calling a run good.

14Platform SLOs: Promises Made by the Cluster Itself

If your applications sit on the platform, the platform’s reliability is a ceiling on theirs.

Platform teams run the shared pieces that every workload depends on: the cluster control plane, scheduling, networking, DNS, ingress and storage. Their customers are the application teams inside the company, and the same SLO thinking applies. The Kubernetes project itself defines scalability targets for things like API call latency and pod startup time, which shows that even the platform has measurable promises.

Platform serviceWhat application teams feelPossible SLI
API serverDeployments and scaling actions that are slow or failShare of API requests that succeed within a latency threshold
Scheduling and pod startupNew pods take too long to appear when traffic surgesShare of pods running within a target time after creation, excluding image pulls
Cluster DNSMysterious timeouts when services look up each otherShare of lookups answered correctly within a threshold
Ingress and gatewayUsers cannot reach any serviceShare of requests that pass through successfully
Node provisioningAutoscaling cannot add capacity fast enoughShare of new nodes ready within a target time
Persistent storageStateful pods stuck waiting for volumesShare of volume attachments completed within a target time
Simple Analogy

Think of a shopping mall. The shops are the applications and the mall’s electricity, water and escalators are the platform. If the escalators break, every shop suffers, no matter how well each shop is run. The mall management therefore has its own promises, such as how quickly it repairs an escalator.

Making the platform a real service

1

Ask application teams what they need

Gather requirements from the main users of the platform. A trading team and a batch analytics team need very different things.

2

Define a small set of platform SLOs

Choose a handful that reflect real user pain, such as ingress availability, pod startup time and DNS success.

3

Publish the results

Share dashboards and monthly reports openly, so application teams can design around real numbers instead of rumours.

4

Use the budget to guide upgrades

Plan cluster upgrades and risky changes according to the remaining platform budget, just as application teams plan releases.

i
Managed Services Have Their Own Promises

If your cloud provider runs the control plane, read their published availability commitments carefully and design around them. Your application SLO cannot exceed what the layers beneath it can deliver unless you add redundancy, for example across zones or clusters.

Example: a platform team that measured DNS

Application teams kept reporting random timeouts. The platform team added a DNS lookup SLI and found that a small share of lookups were slow during busy periods. They scaled the DNS service and added local caching. The platform SLO improved, and many unexplained application errors disappeared with it.

15Kubernetes Features That Protect Your SLO

Kubernetes ships with many tools for reliability. Most SLO failures come from using them half-way.

Feature

Readiness probes

Tell Kubernetes when a pod is ready to receive traffic. A pod that is not ready is removed from the service, protecting users from half-started or struggling pods.

Feature

Liveness and startup probes

Liveness probes restart stuck containers. Startup probes give slow-starting applications time before the other probes begin judging them.

Feature

Rolling update settings

Control how many extra pods may be added and how many may be unavailable during a release, shaping how much capacity stays in service.

Feature

Pod disruption budgets

Limit how many pods of a service may be removed at once during voluntary actions such as node drains and upgrades.

Feature

Topology spread and anti-affinity

Spread replicas across nodes and zones so that one failure does not remove too many pods together.

Feature

Autoscaling

Adds pods or nodes as demand rises so that overload does not turn into errors and slow responses.

Feature

Graceful termination

Gives pods time and a signal to finish in-flight requests before they stop, avoiding errors during rollouts and scale-downs.

Feature

Resource requests, limits and priority

Reserve capacity for important workloads and decide who is stopped first when a node is short of resources.

Simple Analogy

Think of a theatre with several ushers. Readiness probes are the usher checking that each seat is ready before seating a guest. Pod disruption budgets are the rule that no more than two ushers may take a break at once. Spreading pods across zones is stationing ushers at every entrance, so a blocked door does not stop the show.

How each feature protects a specific SLI

Risk to the SLOFeature that helpsCommon half-way mistake
Traffic sent to pods not readyReadiness probeProbe checks only that the process runs, not that dependencies and caches are ready
Errors during rolloutsRolling update settings plus graceful terminationNo pre-stop delay, so traffic still arrives after the pod begins shutting down
Too many pods lost at once during upgradesPod disruption budgetBudget set so strictly that node drains and upgrades get stuck
Zone or node failureTopology spread across zones and nodesReplicas all placed on the same node because spread rules are missing
Overload during traffic surgesAutoscaling with sensible headroomScaling on CPU only, ignoring request queue length or latency
Important pods killed under node pressureHonest requests, limits and priorityCritical pods deployed with no resource settings
Single point of failureAt least two or three replicasOne replica for a user-facing service “to save money”

The shutdown race that spends budget at every release

When a pod is told to stop, two things happen at roughly the same time: it receives a termination signal, and it is removed from the list of pods that receive traffic. These are not perfectly synchronised, so for a short moment requests may still arrive at a pod that has started shutting down. If the pod exits immediately, those requests fail. The fix is simple: add a short delay before shutdown begins, let the application finish in-flight requests when it receives the signal, and give the pod enough grace time to do both. Teams that fix this often recover a surprising share of their error budget.

i
Test Features Under Failure

Probes, disruption budgets and spread rules are only proven when you break things on purpose. Drain a node, kill a pod mid-request and roll out a bad version in a test cluster. Watch the SLI. If it dips, you have found a gap before your users did.

!
Disruption Budgets Cover Only Voluntary Actions

A pod disruption budget limits planned removals such as drains. It cannot prevent a node from crashing or a zone from failing. Treat it as protection against your own maintenance, not against accidents, and use replication and spread to handle the accidents.

16Where the Budget Goes: Mapping Failures to Spending

Knowing the total budget is useful. Knowing what spends it is how you improve.

Every failure that users feel spends some budget. If you record, after each incident, how much it cost and why, a pattern emerges within a few months. Some causes are frequent and cheap, such as brief errors during rollouts. Others are rare and expensive, such as a zone outage. Both deserve attention, but they need different remedies, and the account of spending tells you where effort pays off most.

CauseTypical shapeTypical remedy
Bad releasesSudden jump in errors shortly after a deploymentCanary rollouts, automated rollback, better testing
Rollout turbulenceSmall bursts of errors at every deploymentGraceful shutdown, readiness tuning, surge settings
Dependency failuresErrors or slowness that start without any change on your sideTimeouts, retries with limits, circuit breakers, fallbacks
Capacity shortfallsLatency and errors rising with trafficAutoscaling tuning, load shedding, headroom
Node or zone failureAbrupt loss of many pods at onceZone spread, enough replicas, faster rescheduling
Noisy neighboursSlowness and kills that correlate with other workloadsHonest requests and limits, priority, node isolation
Configuration mistakesFailures caused by a wrong setting, secret or certificateValidation in pipelines, policy checks, expiry monitoring
Planned maintenanceShort, predictable dips during upgradesDisruption budgets, surge capacity, rolling node upgrades
Simple Analogy

Think of a household budget. Looking only at the total spent each month tells you little. Sorting spending into rent, food, transport and entertainment shows where to save. An error budget ledger sorts reliability spending into causes so that you can cut the biggest category first.

A habit that pays off: tag every budget loss

1

Record the incident

Note start time, end time and affected journeys for every event that spent a noticeable part of the budget.

2

Calculate its cost

Compute the share of the budget used, using the same event counts that the SLO itself uses.

3

Assign a cause category

Place it in a small, stable list of categories, such as release, dependency, capacity, infrastructure and configuration.

4

Review the ledger monthly

Look at which categories spent the most and choose the next reliability investments from that evidence.

Example: a surprise from the ledger

A team believed that infrastructure failures were their main problem. After three months of tagging, the ledger showed that half the budget was lost to tiny error bursts during their own deployments. A small change to graceful shutdown and rollout settings recovered most of that, far more cheaply than any infrastructure project.

i
Spending on Purpose Is Allowed

Some budget should be spent deliberately: on game days, chaos experiments and risky but valuable launches. Treat planned spending as an investment, announce it, and make sure the budget is healthy before doing it.

17Dependencies and Composite SLOs

A chain is only as strong as its weakest link, and with microservices the chains are long.

Reliability multiplies down a chain

If a request must pass through several services in a row, and each must succeed for the request to succeed, the overall reliability is roughly the product of their individual reliabilities. Three services that are each ninety-nine point nine percent reliable give about ninety-nine point seven percent overall. Five such services give about ninety-nine point five percent. Every service you add to the critical path lowers the best reliability you can offer unless you protect against its failures.

flowchart LR
    subgraph S["Serial chain: every step must work"]
        A["Gateway 99.9%"] --> B["Orders 99.9%"] --> C["Payments 99.9%"] --> D["Database 99.9%"]
    end
    subgraph P["Redundant pair: either can work"]
        E["Replica A 99%"] --- F["Replica B 99%"]
    end
    S --> R1["About 99.6% overall"]
    P --> R2["About 99.99% overall"]
        
FIG 4 — Serial dependencies lower reliability, while redundancy raises it

The diagram shows the two basic shapes. In a serial chain, each step adds a chance of failure, so four steps at three nines each allow about four times as much failure as any one of them alone, which is roughly ninety-nine point six percent overall. In a redundant arrangement, a request fails only if both copies fail at the same time, so two copies at ninety-nine percent each can reach roughly four nines, provided their failures are truly independent.

Simple Analogy

Think of a string of old festival lights where one broken bulb darkens the whole string. The more bulbs in the string, the likelier it is that one has failed. Wiring bulbs in parallel, so each has its own path, keeps the lights on when one dies. Serial dependencies are the old string, and redundancy is the parallel wiring.

What this means for setting targets

SituationWhat to do
Your target is higher than a hard dependency’s reliabilityAdd a fallback, cache, queue or redundancy, or lower your target honestly
Many services in a serial chainShorten the chain, make some calls optional or asynchronous, and set tighter targets for the most critical links
A flaky dependency owned by another teamAgree on a shared SLO for it, and protect yourself with timeouts and circuit breakers
A third-party service outside your controlRead its published commitments, design degraded behaviour, and count its failures in your own budget

Protecting yourself from dependencies

Tactic

Timeouts

Never wait forever. A slow dependency should fail fast so that requests do not pile up and exhaust your own pods.

Tactic

Limited retries

Retry transient failures a small number of times with delays. Unlimited retries can turn a small problem into a storm.

Tactic

Circuit breakers

Stop calling a failing dependency for a short time, returning a fallback instead, and test it again gradually.

Tactic

Graceful degradation

Serve a simpler but useful answer when a non-essential dependency is down, such as products without recommendations.

!
Retries Multiply Load

If every layer retries three times, one user request can become dozens of calls at the bottom of the stack, just when the dependency is weakest. Limit retries, add random delay between them, and retry only at one layer.

18The Error Budget Policy: Turning Numbers into Decisions

A budget with no consequences is just a chart. The policy is what makes it matter.

An error budget policy is a short document, agreed by product, engineering and operations, that says in advance what happens at different levels of budget. It removes arguments in the heat of the moment. When the budget is healthy, teams may move fast and take risks. When it is low, they shift effort toward reliability. When it is exhausted, new feature releases pause until the service recovers. Because everyone agreed in advance, the decision feels fair rather than personal.

flowchart TD
    A["Check remaining error budget"] --> B{"More than half remaining?"}
    B -->|"Yes"| C["Ship normally and allow planned experiments"]
    B -->|"No"| D{"Any budget left?"}
    D -->|"Yes"| E["Slow risky changes and prioritise reliability fixes"]
    D -->|"No"| F["Freeze feature releases and focus on reliability work"]
    F --> G["Resume when budget recovers and causes are fixed"]
        
FIG 5 — A simple error budget policy as a decision flow

The flow shows the idea in its simplest form. Real policies add detail, such as which kinds of changes are still allowed during a freeze, but the principle is the same: the remaining budget decides how much risk the team may take right now.

Simple Analogy

Think of a household that agrees on spending rules. When there is plenty of money, a holiday is fine. When the account runs low, they cut non-essential purchases. When it hits zero, only essentials are bought until the next payday. The rules were agreed in calm times, so nobody fights when money gets tight.

What a good policy contains

Part

Thresholds and actions

Clear levels of remaining budget, each linked to a concrete action such as a review, a slowdown or a freeze.

Part

Exceptions

What may still ship during a freeze, such as security fixes and changes that improve reliability.

Part

Ownership and escalation

Who decides, who can override, and how disagreements are settled, ideally by a named leader from the product side.

Part

Review rhythm

A regular meeting to look at the budget, the ledger of causes and the targets themselves.

What the policy gives the business

Benefits

  • Shared language between product and engineering
  • Faster releases while the budget is healthy
  • Automatic, fair pauses when reliability slips
  • Fewer heated debates after incidents
  • Clear evidence for investing in reliability work

Costs and risks

  • Needs buy-in from leaders, or it will be ignored
  • Takes effort to measure and report honestly
  • A badly chosen target makes the policy too strict or too loose
  • Teams may be tempted to game the measurement
i
Too Much Budget Is Also a Signal

If a service ends every window with most of its budget unused, the target may be too loose, or the team may be too cautious. Consider releasing faster, running more experiments, or raising the target if users would benefit.

19Releasing Safely: SLOs as the Gate for Progressive Delivery

The cheapest incident is the one you stop at five percent of traffic.

Deployments are the most common cause of budget loss, and they are also the one cause fully in your control. Progressive delivery reduces the damage by sending a new version to a small share of users first, comparing its SLIs with the old version, and promoting it only when it is at least as good. Tools for Kubernetes, such as Argo Rollouts and Flagger, automate this by analysing metrics during the rollout and rolling back when thresholds are crossed.

flowchart LR
    A["New version deployed"] --> B["Send 5% of traffic"]
    B --> C{"SLIs healthy compared with the baseline?"}
    C -->|"Yes"| D["Raise to 25%, then 50%, then 100%"]
    C -->|"No"| E["Roll back automatically"]
    D --> F{"Healthy at each step?"}
    F -->|"Yes"| G["Release complete"]
    F -->|"No"| E
        
FIG 6 — A canary rollout gated by SLIs

The diagram shows the loop. Each step checks the same indicators that the SLO uses, such as error ratio and latency under threshold. A bad release then affects a small fraction of users for a few minutes, spending a tiny part of the budget instead of a large one.

Simple Analogy

Think of a restaurant testing a new dish. Instead of putting it on every table at once, the chef serves it to a few guests and watches their reactions. If they smile, it goes on the menu. If they push the plate away, the chef changes it, and almost nobody was disappointed.

Ways to connect releases to the budget

1

Use SLIs as automated gates

Define the canary check using the same ratios as the SLO, so what counts as healthy during a rollout matches what counts as healthy in production.

2

Check the budget before a risky release

Let the pipeline read the remaining error budget and require extra approval, or block the release, when it is low.

3

Roll back first, investigate later

When the burn rate spikes after a release, rolling back is almost always the fastest way to protect the budget.

4

Learn from every rollback

Add a test or check that would have caught the problem earlier, and note the budget spent in the ledger.

!
Small Canaries Need Enough Traffic

If five percent of traffic is only a handful of requests, the comparison is statistical noise. Use longer observation, a larger canary share, or synthetic traffic so that a real problem can be told apart from chance.

20Tooling and SLOs as Code

Writing the rules by hand for every service does not scale. Treat SLOs like any other configuration in your repository.

Why define SLOs in files

An SLO defined in a short, declarative file can be reviewed, versioned and reused. The same file can generate the recording rules, the alert rules and the dashboards, so they never drift apart. When a target changes, the change goes through code review, leaving a record of who agreed and why. This is the same discipline Kubernetes teams already apply to deployments, so it feels natural.

Tool type

SLO generators

Open-source projects such as Sloth and Pyrra turn a short SLO definition into the full set of metric rules and multi-window burn rate alerts, so engineers do not write them by hand.

Tool type

Vendor-neutral specifications

Specifications such as OpenSLO describe SLOs in a common format, helping teams move between tools and share definitions.

Tool type

Dashboards and reports

Dashboards show remaining budget, burn rate and history, and monthly reports share the results with leaders.

Tool type

Commercial platforms

Observability vendors and cloud providers offer built-in SLO features, which can be convenient if you already use their monitoring.

Simple Analogy

Think of a recipe card versus cooking from memory. A written recipe lets anyone reproduce the dish, lets you improve it step by step, and shows what changed when the taste drifts. SLOs as code are the written recipe for your reliability.

A sensible way to roll out the tooling

1

Pick one metrics source and one tool

Start with whatever your team already runs. A simple setup used everywhere beats a perfect one used by nobody.

2

Create a template for common services

Provide a ready-made SLO file for a standard web service, so teams only fill in service names and targets.

3

Store SLO files beside the service code

Keep them in the same repository as the deployment configuration, and review them together.

4

Deploy them through the same pipeline

Apply SLO definitions to the cluster with the same automation that applies workloads, so every change is tracked.

5

Test the alerts

Inject a controlled failure in a test environment and confirm that the right alert fires at the right time and clears afterwards.

i
Check Current Tool Capabilities

SLO tools evolve quickly, and supported metrics sources, features and installation methods change between versions. Read the documentation for the exact version you plan to adopt before committing to a design.

21Rolling Out an SLO Practice: A Ninety-Day Plan

SLOs succeed or fail on people and habits at least as much as on tools.

Many organisations try to introduce SLOs for every service in one big push, and then give up when the work overwhelms the teams. A better approach is to start small, prove the value on one or two important services, and let success pull other teams in. The plan below spreads the work across about three months and is meant as a pattern, not a rigid schedule.

1

Weeks 1 to 2: choose pilots and journeys

Pick one or two services that matter to users and have willing owners. List their key user journeys and decide which ones need an SLO first.

2

Weeks 3 to 4: define SLIs and measure

Write precise good and valid event definitions, wire up the metrics, and watch the numbers without any targets or alerts. Learn what normal looks like.

3

Weeks 5 to 6: agree on targets and the policy

Hold a short workshop with product, engineering and operations. Choose first targets, write a one-page budget policy and agree who owns decisions.

4

Weeks 7 to 8: alerts and dashboards

Add multi-window burn rate alerts, a team dashboard and runbooks. Replace old noisy alerts that these new ones make unnecessary.

5

Weeks 9 to 10: run it for real

Use the budget in planning and release decisions. Start the ledger of causes and hold the first monthly review.

6

Weeks 11 to 13: review and spread

Adjust targets and alerts based on experience, document lessons, create templates, and invite the next group of services to join.

Simple Analogy

Think of starting a fitness routine. Trying to change every habit in one week usually ends in giving up. Starting with one short daily walk, tracking it and enjoying the results makes the next habit easier to add. An SLO practice grows the same way, one service at a time.

Roles that make it work

Role

Product owner

Speaks for users, helps choose targets and agrees to the policy, including accepting a release freeze when the budget is gone.

Role

Service team

Owns the SLIs, responds to alerts, keeps the ledger and decides how to spend reliability effort.

Role

Platform or reliability team

Provides templates, tooling and coaching, and owns platform-level SLOs.

Role

Engineering leadership

Backs the policy publicly, so that it survives its first uncomfortable moment.

!
Do Not Use SLOs to Punish

If missing an SLO leads to blame, teams will hide problems or measure in flattering ways. Treat a breach as a signal about the system and the targets, and review it in a blameless way. Honest numbers are worth far more than good-looking ones.

22Design Patterns and Anti-Patterns

Teams that do well with SLOs repeat a few good habits. Teams that struggle repeat a few well-known mistakes.

Patterns that work

Pattern

Few SLOs per service

One or two per user journey, usually availability and latency, so every SLO is understood and acted upon.

Pattern

Measure at the edge

Take the main SLI from the ingress or load balancer, closest to users, and add application metrics for correctness.

Pattern

Burn rate alerts at several levels

Fast pages for severe outages and tickets for slow leaks, each pairing a long window with a short one.

Pattern

SLOs as code with a shared template

Reviewed definitions in the service repository, generating rules and dashboards automatically.

Pattern

Budget ledger and monthly review

A simple record of what spent the budget and a regular meeting to pick the next investments.

Pattern

Canary gates using the same SLIs

Progressive delivery judged by the same ratios as production, so a rollout cannot look healthy by a different standard.

Anti-patterns to avoid

ANTI-PATTERN-01 Avoid
Problem

The team sets every SLO at 99.99 percent because “our customers expect the best.”

Why It’s Harmful

The budget is only a few minutes per month, so almost any release or incident breaches it. The policy freezes releases constantly, and soon everyone ignores the SLO.

Correct Approach

Start from measured performance and real user needs, choose a target the team can meet most months, and tighten it only when the business case is clear.

ANTI-PATTERN-02 Avoid
Problem

The SLO is defined from pod metrics such as restarts and CPU, because they are easy to collect.

Why It’s Harmful

These measure causes, not user experience. The dashboard can stay green during an ingress failure and turn red during a harmless restart, so nobody trusts it.

Correct Approach

Define SLIs from what users receive, measured at the edge or by synthetic probes, and keep cause metrics for diagnosis only.

ANTI-PATTERN-03 Avoid
Problem

SLOs exist on a dashboard, but there is no agreed policy and nobody changes behaviour when the budget runs out.

Why It’s Harmful

The numbers become decoration. Releases continue during a breach, reliability work never gets priority, and the team concludes that SLOs are a waste of time.

Correct Approach

Write a one-page policy with product and leadership, and actually follow it, starting with small, visible actions.

ANTI-PATTERN-04 Avoid
Problem

Pages fire whenever the error rate crosses a fixed threshold for five minutes, in addition to the SLO alerts.

Why It’s Harmful

Short blips wake people for events that cost almost nothing, while slow leaks pass unnoticed. On-call fatigue grows and the real alerts get ignored.

Correct Approach

Replace threshold alerts with multi-window burn rate alerts, keeping only cause-based alerts that point to an action and a runbook.

23Best Practices and Common Mistakes

If you keep only one chapter for your next planning meeting, keep this one.

Do This

  • Start from user journeys and choose one or two SLIs for each
  • Define good and valid events in plain language, and write them down
  • Measure close to the user, and add synthetic probes for low-traffic journeys
  • Use rolling windows in multiples of seven days
  • Alert with multi-window burn rates, and give every page a runbook
  • Agree on a budget policy with product and leadership, then follow it
  • Keep a ledger of what spends the budget and review it monthly
  • Protect the SLO with probes, graceful shutdown, spread, replicas and canary rollouts

Avoid This

  • Copying a famous company’s targets without checking your own users
  • Measuring CPU, memory or restarts and calling them SLOs
  • Counting health checks and client mistakes as valid events
  • Using average latency instead of thresholds and tail ratios
  • Paging on single blips or on causes nobody can act on
  • Ignoring dependencies when setting a target
  • Using breaches to blame people instead of improving systems
  • Setting SLOs once and never reviewing them

A quick health check for your SLO practice

1

Can a new engineer explain the SLO in one minute?

If the definition is complicated, simplify it. An SLO that few understand will not guide decisions.

2

Did the budget influence a decision last month?

If nothing changed because of it, the policy is not working and needs support from leadership.

3

Did every page lead to an action?

Pages with no action should become tickets or be deleted.

4

Does the SLI match what users complain about?

Compare support tickets with SLI dips. If complaints appear while the SLI is green, the SLI is missing something.

5

Is the target still right?

Check whether the budget is always empty or always full, and whether user needs have changed.

i
Compare SLIs with Customer Feedback

The best test of an SLO is whether it matches real customer happiness. Once a quarter, line up support tickets and social complaints against the SLI graph. Where they disagree, you have found a blind spot to fix.

24Real-World and Industry Examples

The details vary by industry, but the shape of the practice is the same everywhere.

Where the idea came from

The vocabulary of SLIs, SLOs and error budgets was popularised by Google’s site reliability engineering teams and their published books. Many organisations, large and small, have since adapted the practice, and the Kubernetes ecosystem has built tools and conventions around it.

Online retail

A retailer sets a strict availability and latency SLO for checkout and payment, a looser one for browsing, and a freshness SLO for stock levels. During a big sale the team watches burn rate closely and pauses unrelated releases when the budget runs low, protecting revenue at the busiest time.

Financial services

A payments company defines SLOs on transaction success and correctness, with tight latency thresholds for card authorisation. Durability and reconciliation accuracy have their own indicators. Canary rollouts gated on the same SLIs keep risky changes away from the full customer base.

Streaming and media

A video service measures playback start success and the share of sessions without buffering interruptions. Encoding and recommendation pipelines use freshness SLOs instead. A shared budget policy lets the team keep shipping new features while protecting the core viewing experience.

Healthcare software

A clinical records provider sets high availability and data durability SLOs for patient-facing systems, and lower targets for analytics. Backup restore tests count as an SLI, because a backup that cannot be restored provides no real protection.

Business-to-business software platforms

A software provider turns internal SLOs into customer-facing SLAs with a safety margin, so that the team gets warnings long before a contractual breach. Customers receive monthly reliability reports taken from the same data as the internal dashboards.

Internal platform teams

A platform group publishes SLOs for ingress, DNS, scheduling and pod startup, and reviews them each month with application teams. When the platform budget is low, risky cluster upgrades are postponed, and application teams plan around the published numbers.

A short end-to-end walkthrough

1

Pick the journey

A ticketing company chooses “buy a ticket” as the most important user journey.

2

Define the SLIs

Good events are purchase requests that succeed within one second. Valid events exclude health checks and rejected inputs.

3

Set the target

After measuring for a month, the team commits to ninety-nine point nine percent over twenty-eight days.

4

Alert on burn rate

Three alert levels page for fast burns and open tickets for slow ones.

5

Use the budget

When a popular concert goes on sale, the team checks the budget, freezes unrelated releases, adds capacity and watches the dashboard together.

“The best SLO is the one a whole company can explain and a whole team will act on.”

25Frequently Asked Questions

Q1What is the difference between an SLI, an SLO and an SLA?

An SLI is a measurement, an SLO is a target for that measurement over a time window, and an SLA is a contract with customers that states consequences if a promise is missed. SLOs are usually stricter than SLAs.

Q2How do I calculate an error budget?

Subtract the SLO target from one hundred percent and apply the result to the number of valid events in the window. A ninety-nine point nine percent target over two hundred eighty million requests allows two hundred eighty thousand failures.

Q3What does burn rate mean?

Burn rate is the current error rate divided by the error rate the SLO allows. A burn rate of one uses the budget exactly over the window, while a burn rate of ten empties it in a tenth of the time.

Q4Should I alert on every SLO breach?

Alert on the danger of a breach, not the breach itself. Multi-window burn rate alerts warn early when the budget is draining fast enough to cause trouble, long before the SLO is actually violated.

Q5Where should I measure the SLI on Kubernetes?

Close to the user. The ingress or load balancer is a strong default for request-based services, combined with application metrics for correctness and synthetic probes for low-traffic journeys.

Q6Why not use CPU and memory as SLIs?

They are causes, not user experience. A service can have high CPU and happy users, or low CPU and failing requests. Use them to diagnose problems, and use user-facing ratios as the SLIs.

Q7Which window length should I choose?

A rolling window of twenty-eight days is a common choice, because it holds exactly four weeks and avoids calendar effects. Some teams add shorter windows for alerting and longer ones for reporting.

Q8How do I handle services with very little traffic?

Use synthetic probes to create steady traffic, use longer windows, and require a minimum number of events before an alert fires. A single failed request should not look like a catastrophe.

Q9How do I define SLOs for batch jobs?

Use the success rate of runs and the freshness of the output, such as time since the last successful result. Also check the quality of the data, since a job that finishes with empty output is not really a success.

Q10What if my dependency is less reliable than my target?

Either lower the target honestly, or add protection such as caching, fallbacks, queues and redundancy. You cannot reliably exceed a hard dependency’s reliability without such measures.

Q11Should planned maintenance count against the budget?

Usually yes, because users experience the failure regardless of the reason. If you want to exclude some maintenance, do it through a clear, documented rule, and prefer designing maintenance so that it causes no user-visible errors at all.

Q12What should happen when the budget runs out?

Follow the agreed policy. Typically feature releases pause, reliability work gets priority, and changes resume once the budget recovers and the main causes are fixed. Security fixes and reliability improvements are normally still allowed.

Q13Can I have too much budget left?

Yes. A budget that is always mostly unused may mean the target is too loose or the team is too cautious. Consider releasing faster, running experiments or tightening the target if users would benefit.

Q14Do Kubernetes health probes replace SLOs?

No. Probes tell Kubernetes whether a single pod should get traffic or be restarted. SLOs describe what users actually experience across the whole service, including problems that probes cannot see.

Q15How many SLOs should a service have?

Keep it small. One or two per user journey, usually availability and latency, is plenty for most services. Add more only when users clearly suffer in ways the first ones miss.

26Summary and Key Takeaways

Kubernetes workloads live in a world of constant change, shared infrastructure and long chains of dependencies. SLOs give that world a simple, shared language: choose what users care about, measure it as good events over valid events, set a target you can honestly meet, and treat the gap as a budget to spend wisely. Burn rate alerts warn you early without waking people for noise. A written policy turns the remaining budget into clear decisions about shipping or fixing. Kubernetes features such as probes, graceful shutdown, spread, replicas and progressive delivery protect that budget, and a ledger of causes shows where to invest next. Start small, keep it honest, and let the numbers replace the arguments.

Key Takeaways

  • Measure what users feel — define SLIs as good events over valid events at a point close to the user, not as pod CPU, memory or restart counts.
  • Pick targets you can meet — start from measured performance and real user needs, remember that each extra nine multiplies cost, and keep the SLO stricter than any customer SLA.
  • The error budget is a currency — it is the failure the SLO allows, and it turns reliability into something you can plan, spend and review.
  • Alert on burn rate — use multiple windows and severity levels so fast outages page quickly, slow leaks become tickets, and alerts clear soon after recovery.
  • Use Kubernetes features fully — readiness probes, graceful shutdown, topology spread, enough replicas, disruption budgets and canary rollouts protect the budget from the most common causes of loss.
  • Mind your dependencies — serial chains multiply failure, so shorten them, add fallbacks and redundancy, and set targets that your dependencies can support.
  • Write the policy and follow it — agree in advance what happens when the budget is healthy, low or gone, keep a ledger of what spends it, and review targets regularly.