TExcelTAD

Writing an SLO Document

An SLO that lives only in a Prometheus rule is a number without a reason. The SLO document records what the service is, which SLIs were chosen and why, the targets, the exclusions, who approved it and when it will be reviewed. It's the reference for every later argument ("why don't 404s count?") and the input for the alert rules.

Template

markdown
# SLO: <service> — <journey>

| | |
|---|---|
| Service owner | <team>, <on-call rotation> |
| Approvers | <engineering lead>, <product lead>, <SRE lead> |
| Status | draft / agreed on <date> |
| Next review | <date, at most a quarter away> |

## Service overview
What the service does, who its users are, which journeys matter most. A diagram of the request path, showing
where the SLIs are measured.

## SLIs and SLOs
| SLI | Good event | Valid event | Measured at | SLO | Window |
|---|---|---|---|---|---|

## Rationale
Why these targets: the SLI's history, user expectations, dependency SLOs, cost.

## Exclusions
Each excluded class of requests and the reason.

## Error budget
Size in requests and in full-outage minutes; link to the error budget policy.

## Alerting
The burn-rate alerts that protect each SLO and where they route (page / ticket).

## Dependencies
Each dependency, its SLO, and what happens to us when it fails.

## Change log
<date>: <change> (<who>, <why>)

A worked example

markdown
# SLO: TAD Market — checkout

| | |
|---|---|
| Service owner | payments team, rotation "payments-primary" |
| Approvers | A. Okafor (eng), L. Chen (product), M. Rossi (SRE) |
| Status | agreed on 2026-03-02 |
| Next review | 2026-06-01 |

## Service overview
`POST /checkout` turns a cart into an order and charges the card through the payment provider. About 6
requests per second at peak, 2.5 million per 28 days. Measured at the ingress gateway (Envoy access metrics).

## SLIs and SLOs
| SLI | Good event | Valid event | Measured at | SLO | Window |
|---|---|---|---|---|---|
| availability | status < 500 and not 429 | all POST /checkout except load tests | gateway | 99.9% | 28 d rolling |
| latency | available and completed in <= 800 ms | as above | gateway histogram | 99% | 28 d rolling |

## Rationale
The last 90 days delivered 99.95% availability and 99.4% under 800 ms. Support tickets rise noticeably when the
checkout error rate exceeds about 0.5% for more than a few minutes. The payment provider's own SLA is 99.95%.
99.9% leaves room for two or three bad deploys a month.

## Exclusions
- requests with the header `x-load-test: 1` (our k6 runs);
- 4xx except 429: they are user errors (expired cart, invalid card), shown and handled in the UI.
  Card declines (402) are business outcomes, not failures.

## Error budget
2,500 failed requests per 28 days (≈ 40 minutes of full outage). Policy: "Error budget policy: checkout".

## Alerting
Multi-window multi-burn-rate alerts: page at 14.4x (1 h / 5 min) and 6x (6 h / 30 min), ticket at 3x (1 d / 2 h)
and 1x (3 d / 6 h). Rules and tests: `slo/checkout-rules.yml`, `slo/checkout-test.yml`.

## Dependencies
| Dependency | Its SLO | If it fails |
|---|---|---|
| payment provider | 99.95% (SLA) | checkout fails; orders are saved as "pending payment" and retried |
| orders database | 99.95% | checkout fails |
| recommendations | none | hidden on the confirmation page (graceful degradation) |

## Change log
2026-03-02: first version (M. Rossi, from the Q1 reliability review)

Note: Keep the latency SLO's threshold on a histogram bucket boundary (here 0.8 s). A threshold between two buckets can't be computed exactly from a Prometheus histogram; see Latency SLOs from Histograms.

Keep the numbers machine-readable

Alert rules, dashboards and reports should all be generated from one source, not copied by hand. Many teams store the SLOs as YAML next to the document (tools such as Sloth, Pyrra and OpenSLO define formats for it; see the Toolkit). The session keeps a minimal spec and uses yq to print the budget table that goes into the document, so the document and the rules can't drift apart:

bash · try it yourself
cat > slos.yaml <<'YML'
service: checkout
requests_per_28d: 2500000
slos:
  - name: availability
    objective: 99.9
  - name: latency-800ms
    objective: 99.0
YML
yq '.slos[] | [.name, .objective] | @tsv' slos.yaml |
while IFS=
  

\t' read -r name objective; do
  awk -v n="$name" -v o="$objective" -v r="$(yq '.requests_per_28d' slos.yaml)" 'BEGIN {
    b = (100 - o) / 100
    printf "%-14s %6.2f%%  budget %8.0f requests  %7.1f full-outage minutes\n", n, o, b * r, b * 28 * 24 * 60
  }'
done
availability    99.90%  budget     2500 requests     40.3 full-outage minutes
latency-800ms   99.00%  budget    25000 requests    403.2 full-outage minutes

Reviewing an SLO

At each quarterly review, ask: Did we meet it? Did missing it (or meeting it) match how users felt, judging by support tickets and complaints? Did the alerts fire when they should have, and only then? Is the budget too easy or impossible? Change the targets with a change-log entry; never silently.

Test yourself

Why does the SLO document record the rationale, not only the targets?

  1. For decoration
  2. So later discussions about changing the target start from the original reasons and data
  3. Prometheus reads it
  4. Auditors require exactly that heading

In the example, why are card declines (402) excluded from the availability SLI?

  1. They are rare
  2. A decline is a correct business outcome, not a failure of the service
  3. They are slow
  4. They come from load tests

Why generate alert rules and the budget table from one SLO spec?

  1. YAML is faster
  2. Copies made by hand drift apart; one source keeps the document, rules and dashboards consistent
  3. Alertmanager requires it
  4. It removes the need for tests