Skip to content

service-level indicator (SLI)

A service-level indicator, or SLI, is a quantitative measure of one aspect of how well a service is doing its job, such as the share of requests that succeed or how quickly they come back. It’s the raw number a team actually measures, the input that a service-level objective then sets a target on.

Google’s Site Reliability Engineering (SRE) book defines an SLI as “a carefully defined quantitative measure of some aspect of the level of service that is provided.” Most SLIs are a ratio of good events to valid events, which reads naturally as a percentage:

A teal "Requests served" box splits into "Valid events" (count all) and "Good events" (count successes), both feeding a "good / valid" circle that arrows into a yellow "SLI 99.95%" box.
An SLI is just the share of valid events that went well, read as a percentage.

Say a service answered 9,995 requests successfully out of 10,000 in the last hour. Its availability SLI for that window is just that ratio:

Language: Python
>>> good_requests = 9_995
>>> total_requests = 10_000
>>> availability = good_requests / total_requests
>>> round(availability * 100, 2)
99.95

How It Shows Up in Practice

A Python developer meets SLIs as the metrics flowing into a service’s observability stack. A request handler increments a success or failure counter, a tool such as Prometheus aggregates the counts, and a dashboard plots the resulting ratio over time.

The SLIs teams reach for most are availability, latency, error rate, and throughput. The exact metric matters less than whether it tracks something a user would actually notice. A CPU graph is easy to collect but says little about whether the service feels broken from the outside.

Choosing a Good SLI

The SRE guidance is to measure the user’s experience, not the machine’s. A checkout endpoint’s SLI should count successful checkouts rather than server load, because the checkout is what a customer feels when it breaks.

Picking the right indicator is what makes the rest of the chain meaningful. A target set on a weak SLI shows a green dashboard while users suffer. Once a team trusts its SLIs, it sets objectives on them and, for paying customers, may promise some of those objectives in a service-level agreement.

Tutorial

Python Timer Functions: Three Ways to Monitor Your Code

In this step-by-step tutorial, you'll learn how to use Python timer functions to monitor how quickly your programs are running. You'll use classes, context managers, and decorators to measure your program's running time. You'll also learn the benefits of each method and which to use given the situation.

intermediate python stdlib

For additional information on related topics, take a look at the following resources:


By Martin Breuss • Updated June 22, 2026