Pcornel
Browse topics
Options
Recent
Favorites
Observability · Technical reference

Choosing SLIs

Direct 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.

When to use this

Use it when defining SLOs for a service.

First 30 seconds

1. Availability SLI: sum(rate(http_requests_total{code!~"5.."}[5m])) / sum(rate(http_requests_total[5m])).

2. Latency SLI: share below threshold via histogram bucket le.

3. Measured at load balancer or client?

4. Valid-event definition.

5. Agree with stakeholders.

Operational verification

user journey → good/valid events → SLI

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
OpenTelemetry / Prometheus / Grafana / common metrics-log-trace pipelines
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformOpenTelemetry / Prometheus / Grafana / common metrics-log-trace pipelines
Scope / prerequisiteUse it when defining SLOs for a service.
What next?2 suggested next steps
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 How to verify Verify boundary

Confirm the SLI dropped during past incidents. Confirm the histogram has a bucket at the latency threshold.

Step 2 Common failures Narrow the fault

Measuring only server-side misses load balancer or network failures. Including health checks inflates availability. Averages are not SLIs.

Key points

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

Key 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
ReferenceWhat it is1 section · depth on demand

How it works

SLIs are computed from counters: good requests and total requests. Latency SLIs count requests faster than a threshold, which needs a histogram bucket at that threshold.

ReferenceImportant terms & boundaries3 sections · depth on demand

Choosing SLIs

Service typeSLI example
Request/responseProportion of requests with status < 500 and latency < 300 ms
Data pipelineProportion of records processed within 10 minutes
StorageProportion of reads that succeed
Batch jobProportion of runs that finish before the deadline

Measure as close to the user as possible (load balancer or client), and define good/total events precisely (exclude health checks).

In depth

SLI = good events ÷ valid events

Write the definition precisely, including what is not counted:

Service typeGood eventsValid events
HTTP APIResponses with status < 500 and latency < 300 msAll requests except health checks and requests rejected for bad input (4xx)
Batch pipelineRuns that finish within 2 h of schedule with correct outputAll scheduled runs
StorageReads that return the written dataAll reads
StreamingMessages processed within 60 s of productionAll messages

From the definition to PromQL

# availability over 30 days
sum(increase(http_requests_total{job="api",code!~"5..",route!="/healthz"}[30d]))
  / sum(increase(http_requests_total{job="api",route!="/healthz"}[30d]))

# latency SLI: share of requests faster than 300 ms (needs a bucket at exactly 0.3)
sum(rate(http_request_duration_seconds_bucket{job="api",le="0.3"}[5m]))
  / sum(rate(http_request_duration_seconds_count{job="api"}[5m]))

Where to measure

Measurement pointSeesMisses
ApplicationDetailed, per routeRequests that never reached it
Load balancer / ingressMost user trafficClient-side and DNS failures
Synthetic probesEnd-to-end path from outsideReal traffic mix
Client (RUM)What users actually experienceNoisy, partial coverage

Start with the load balancer for availability and latency, add synthetic probes for low-traffic paths, and check the SLI against history: it must have dropped during every real incident you remember, and must not have dropped when nothing was wrong.

Setting the target

Pick a target slightly below what the service achieves today and what users have been content with, not 100 %. 99.9 % over 30 days allows about 43 minutes of full outage.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Common mistakes

  • SLIs that do not reflect user experience.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
choosing slisservice level indicatorsli definition
Confirmation

Confirm action

Continue?