Pcornel
Observability · SLI, SLO & Error Budgets

Choosing SLIs

Cheat sheet · https://pcornel.dk/topic.php?topic=6225

Back to the Topic

Answer

Choosing SLIs: pick measurements that reflect user experience — availability (good/valid requests), latency (requests below a threshold), freshness, correctness — measured as close to the user as possible.

Remember

Express SLIs as good events / valid events. Exclude invalid requests (e.g. 4xx caused by clients) deliberately. Fewer SLIs are better.

First checks

  • sum(rate(http_requests_total{code!~"5.."}[5m])) / sum(rate(http_requests_total[5m])) — first check for this topic
  • curl -s localhost:9090/-/ready — Prometheus ready
  • curl -s 'localhost:9090/api/v1/query?query=up' — scrape targets up/down
  • promtool check config prometheus.yml — config valid

Verify in this order

user journey → good/valid events → SLI

Where it usually breaks

Measuring only server-side misses load balancer or network failures.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6225

Confirmation

Confirm action

Continue?