Engineering organisations measure themselves with a pile of acronyms that are easy to confuse and costly to misuse. An OKR sets a goal; a KPI tracks how the business is performing; a KRI warns that a risk is growing; an SLI measures what users experience; an SLO sets the target for it; an SLA is a contract with consequences. This lesson follows one reliability problem from a quarterly objective to a funded decision, and shows how each measure helps, and the two classic mistakes: measuring the wrong thing, and promising customers more than you aim for.
Difficulty: Intermediate · Know this first: Lesson 172, Lesson 171
This bar splits the time from the first failures to a funded fix, in days. It is a worked example, not a measurement. The KPI and SLA hops are where the wrong measures add weeks.
Set the SLO target, the daily request volume, and today's error rate. The window is 28 days. The burn rate says how many times faster than allowed the budget is being spent.
budget = 1 − target · full-outage minutes = 28 × 1,440 × budget · burn rate = error rate ÷ budget · days to exhaust = 28 ÷ burn rate
Burning: the budget will run out in two weeks
Three questions. No score is saved anywhere — this is just you against the material.
Engineering metrics grow in four levels: first the definitions, then writing good SLIs and SLOs, then error budget policy and KRIs, and finally a small, connected set of measures for an organisation.
At the basic level you can tell the measures apart.
Try it: Basic
A team's SLO is "99.9 percent of API requests succeed over 28 days". What is the SLI?
Now do it: Write one SLI and one SLO for a service you know, in the form good ÷ valid, target, window.
At the intermediate level you write indicators that match user experience.
Try it: Intermediate
A latency SLI is "average response time under 300 ms". What is wrong with it?
Now do it: Rewrite one average-based latency target you know as a "share of requests under X" SLI.
At the advanced level measures change what teams do.
Try it: Advanced
The error budget is exhausted ten days into the window. What does a good error budget policy say?
Now do it: Draft a three-line error budget policy for one service and who signs it.
At the master level an organisation measures a few things well, and they connect.
Trade-off: more measures look thorough and dilute attention; fewer measures focus attention and miss some risks, which KRIs and reviews must catch.
Try it: Master
A team is told to raise deploy frequency and starts splitting changes into trivial deploys, while change failures rise. What is the fix?
Now do it: For one measure your team is judged by, name the measure that should be paired with it.
An SLI, an SLO, and burn-rate alerts written down as code: Prometheus recording rules and alerts, using the multi-window approach from the Google SRE workbook.
groups:
- name: checkout-slo
rules:
# SLI: share of checkout requests that failed, over several windows
- record: checkout:error_ratio:rate5m
expr: |
sum(rate(http_requests_total{route="/checkout",code=~"5.."}[5m]))
/ sum(rate(http_requests_total{route="/checkout"}[5m]))
- record: checkout:error_ratio:rate1h
expr: |
sum(rate(http_requests_total{route="/checkout",code=~"5.."}[1h]))
/ sum(rate(http_requests_total{route="/checkout"}[1h]))
- record: checkout:error_ratio:rate6h
expr: |
sum(rate(http_requests_total{route="/checkout",code=~"5.."}[6h]))
/ sum(rate(http_requests_total{route="/checkout"}[6h]))
- record: checkout:error_ratio:rate30m
expr: |
sum(rate(http_requests_total{route="/checkout",code=~"5.."}[30m]))
/ sum(rate(http_requests_total{route="/checkout"}[30m]))
# page: 2 percent of a 30-day budget in 1 hour (burn rate 14.4)
- alert: CheckoutErrorBudgetFastBurn
expr: checkout:error_ratio:rate1h > 14.4 * 0.001 and checkout:error_ratio:rate5m > 14.4 * 0.001
labels: {severity: page}
# ticket: 5 percent of the budget in 6 hours (burn rate 6)
- alert: CheckoutErrorBudgetSlowBurn
expr: checkout:error_ratio:rate6h > 6 * 0.001 and checkout:error_ratio:rate30m > 6 * 0.001
labels: {severity: ticket}
0.001 is the error budget of a 99.9 percent SLO. The short window in each alert makes it stop firing soon after the problem ends. Tools such as Sloth or Pyrra generate rules like these from a short SLO definition.
This is a composite of a failure pattern that keeps repeating; the numbers are illustrative. A company paid its largest customer service credits three months running while its reliability dashboard was green.
Every SLA must reference an SLO at least as strict, reviewed by engineering before signature; the SLO for that API is raised to 99.97 percent with funded work to meet it, and new contracts default to 99.9 percent.
Define the measures for a payments platform: the quarter's OKR, three KPIs, three KRIs, and SLIs and SLOs for its two most important journeys, with any SLA customers will see.
Which journeys matter most to customers and revenue? What did the last year of incidents look like? What do contracts already promise? Which risks have auditors raised?
Say 3 million payment attempts a day, 99.95 percent success historically, p95 latency of 600 ms, and enterprise customers asking for an SLA.
OKR: "payments customers can rely on" with key results on SLO attainment and change failure rate; KPIs: authorisation rate, revenue per day, lead time; KRIs: certificate expiry, critical vulnerability age, untested backups; SLIs: payment success at the edge, latency under 1 s; SLOs 99.95 and 99 percent over 28 days; SLA 99.9 percent with credits; burn-rate alerts and a signed budget policy.
Stricter SLOs please customers and cost engineering time and features. An SLA wins deals and creates a financial liability. More KRIs cover more risk and dilute attention.