SLIs, SLOs and runbooks
SLIs, SLOs and runbooks
A service level indicator (SLI) is a defined reliability measurement. A service level objective (SLO) is its target over a specified window; an error budget is the tolerated amount of bad service under that objective.
Define a user-centered eligible population first: for a reservation endpoint, count valid user requests and mark a request good only if it returns the correct outcome within a specified duration. Business denials may count as good if they are correct; exclusions must be stable, documented and not used to hide outages. The success SLI is good / eligible; when no requests are eligible, report unknown or no data rather than 100%. For a request-based 99.9% objective, the allowed bad fraction is 0.1%; the budget in a given window depends on eligible requests. Burn rate is the observed bad fraction divided by the allowed bad fraction. A rate above one consumes budget faster than the target's nominal rate; short noisy windows can mislead, so use agreed long and short alert windows and minimum traffic rules. Latency goals should count eligible requests meeting the threshold instead of averaging percentiles across hosts. A service-level agreement is a separate contractual promise, not necessarily the engineering target. A runbook includes trigger, scope, owners, evidence, safe mitigation, escalation, rollback/recovery checks and communication. A blameless postmortem records impact, timeline, contributing factors, evidence, action owners and due dates; do not claim a single cause without evidence. The following numbers are modeled, not measured SLO performance. See lab-fixtures/diagnostics-v28/runbook.md for a fictional inventory API runbook and postmortem template.
Baseline: .NET 10 / C# 14. All C# results below are reasoned, not executed. Models, in-process integrations and actual runtime or UI tests are distinguished.
Compute a request-based error budget
Use 10,000 eligible requests with 14 bad outcomes; the objective is 99.9%. Decimal arithmetic avoids binary floating-point representation surprises.
Inspect the archived Fixture.csproj and use only an approved .NET 10 SDK. Build and run in an isolated lab with finite time and resource limits.
using System;using System.Globalization;int eligible = 10000, bad = 14;decimal objective = 0.999m;decimal allowedBad = eligible * (1 - objective);decimal remaining = allowedBad - bad;decimal sli = 100m * (eligible - bad) / eligible;Console.WriteLine("SLI=" + sli.ToString("0.00", CultureInfo.InvariantCulture) + "%");Console.WriteLine("budget=" + allowedBad.ToString("0", CultureInfo.InvariantCulture) + "; remaining=" + remaining.ToString("0", CultureInfo.InvariantCulture));Expected result (not executed):
SLI=99.86%budget=10; remaining=-4A negative remaining budget means the objective was missed over this population. The calculation does not predict future traffic.
Compute burn rate and handle empty windows
Compare a short 1,000-request window with 4 bad results to a no-traffic window.
Inspect the archived Fixture.csproj and use only an approved .NET 10 SDK. Build and run in an isolated lab with finite time and resource limits.
using System;using System.Globalization;string Burn(int eligible, int bad) { if (eligible < 0 || bad < 0 || bad > eligible) throw new ArgumentOutOfRangeException(); if (eligible == 0) return "no data"; decimal burn = (decimal)bad / eligible / 0.001m; return burn.ToString("0.0", CultureInfo.InvariantCulture) + "x";}Console.WriteLine(Burn(1000, 4));Console.WriteLine(Burn(0, 0));Expected result (not executed):
4.0xno dataFour times the allowed bad fraction is a burn rate of four. It is not automatically a paging rule; window length, sample count and impact matter.
Count good latency-and-correctness outcomes
The latency target is at most 200 ms. Business-denied but correct responses can be good under the stated contract.
Inspect the archived Fixture.csproj and use only an approved .NET 10 SDK. Build and run in an isolated lab with finite time and resource limits.
using System;using System.Linq;var requests = new[] { (Eligible: true, Correct: true, Ms: 100), (Eligible: true, Correct: true, Ms: 200), (Eligible: true, Correct: true, Ms: 201), (Eligible: true, Correct: false, Ms: 50), (Eligible: false, Correct: false, Ms: 10)};int eligible = requests.Count(r => r.Eligible);int good = requests.Count(r => r.Eligible && r.Correct && r.Ms <= 200);Console.WriteLine($"good={good}; eligible={eligible}; bad={eligible-good}");Expected result (not executed):
good=2; eligible=4; bad=2The explicit conjunction avoids counting fast but incorrect responses as good. Excluded requests must be governed by the documented definition; telemetry gaps are not automatically exclusions.
Apply the concept
Define a 99.5% correctness-and-latency SLO for a fictional 30-day inventory API, with 20,000 eligible requests and 140 bad outcomes. Calculate the budget and burn rate and outline a runbook.
Use the manual practice and knowledge check. Do not deploy or publish these fixtures.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
SLIs, SLOs and runbooks — knowledge check
Apply the lesson concepts to the following scenarios.
What is an SLI?
What is the budget for 99% over 1,000 eligible requests?
What does a burn rate of 2 mean?
How should an empty request window be reported?
What belongs in a postmortem?