Why Observability Is Critical for SLIs and SLOs
Why SLIs and SLOs depend on observability: choosing SLIs, Prometheus recording rules, burn-rate alerts from the SRE workbook and tracing a burning SLO.
Observability is critical for SLIs and SLOs because an SLO is only as trustworthy as the data behind its indicator. Metrics measure the SLI and drive burn-rate alerts, traces show which component spent the error budget, and logs explain individual failures. Without all three, teams either miss SLO breaches or cannot fix them quickly.
This guide explains how to choose SLIs, how to measure them with the observability data you already collect, how to alert on error budget burn and how to use traces and logs when an SLO is at risk. It is part of our site reliability engineering cluster.
Key takeaways
- The Google SRE book defines an SLI as a carefully defined quantitative measure of some aspect of service level, and an SLO as a target value or range for that SLI.
- Measure SLIs as close to the user as you can, usually at the load balancer or API gateway, and express them as good events divided by valid events.
- Use percentiles, not averages, for latency. Averages hide the slow tail that users notice.
- Alert on error budget burn rate, not on raw thresholds. The SRE workbook recommends paging at a burn rate of 14.4 over one hour (with a five-minute short window) for a 99.9 percent SLO.
- Traces and logs turn an SLO alert into a diagnosis by showing which dependency, endpoint or customer segment is failing.
- OpenTelemetry gives one way to emit all three signals, but signal maturity differs by language, so check its status page for your SDK.
SLI, SLO and SLA in plain terms
| Term | What it is | Example |
|---|---|---|
| SLI (service level indicator) | A measured property of the service as users experience it | Share of checkout requests that return a non-5xx response |
| SLO (service level objective) | A target for an SLI over a time window | 99.9 percent of checkout requests succeed over 30 days |
| Error budget | The allowed amount of failure implied by the SLO | 0.1 percent of requests over 30 days |
| SLA (service level agreement) | A contract with consequences, often financial, for missing objectives | Service credits if monthly availability falls below an agreed level |
The SRE book notes that if an agreement has no explicit consequence, it is really an SLO. Internal SLOs are normally stricter than external SLAs, so the team has warning before a contract is at risk.
Why monitoring alone is not enough
Traditional monitoring checks known failure conditions: CPU above a threshold, a process down, a disk filling up. Those checks still matter, but they answer "is this component healthy?" rather than "are users getting what they need?" A service can have green dashboards while a slow dependency makes one in fifty checkouts time out.
Observability is the ability to ask new questions of your telemetry without shipping new code. For SLOs that means two things. First, the SLI must be measured from data that reflects real user requests. Second, when the SLI drops, you must be able to break it down by endpoint, region, version, customer tier or dependency until the cause is visible. The difference is covered in depth in observability vs traditional monitoring.
Choosing good SLIs
The SRE book advises picking a small number of SLOs that cover what users care about. If an SLO never helps settle a priority debate, it may not be worth keeping. Common SLI types are:
- Availability: the share of valid requests that succeed.
- Latency: the share of requests faster than a threshold, such as 300 ms.
- Freshness: for data pipelines, the share of reads that see data updated within a set time.
- Correctness: the share of outputs that are correct, measured by validation jobs.
- Throughput or completion: for batch jobs, the share of jobs completed within their deadline.
Express each SLI as a ratio of good events to valid events. That makes the SLO, the error budget and the burn rate easy to compute, and it works the same way for request-based services and pipelines.
Where to measure
Measure as close to the user as practical. Load balancer or gateway logs and metrics capture failures that never reach your application, such as connection errors. Application metrics give more detail but miss failures in front of the app. Client-side measurement (real user monitoring or synthetic probes) is closest to the user but noisier. Many teams use gateway metrics for the SLI and application telemetry for diagnosis.
Use percentiles for latency
The SRE book warns that averages hide slow outliers. A median of 80 ms can coexist with a 99th percentile of several seconds. Define latency SLIs as "proportion of requests faster than X", which is equivalent to a percentile target and fits the good-over-valid model.
The three pillars and what each contributes
| Signal | Role for SLOs | Typical tools |
|---|---|---|
| Metrics | Compute the SLI continuously and cheaply; drive burn-rate alerts and dashboards | Prometheus, cloud monitoring services |
| Traces | Show which service or dependency added latency or errors to a failing request | OpenTelemetry with Jaeger, Tempo or a vendor backend |
| Logs | Give the detail of individual failures: error messages, inputs, stack traces | ELK, Loki, cloud logging services |
Link the three together. Put the trace ID in every log line, attach exemplars (sample trace IDs) to latency histograms where your tools support them, and use the same service and environment labels everywhere. Then a responder can jump from a burning SLO to a slow trace to the log line that explains it.
Measuring an SLI with Prometheus
Recording rules precompute the SLI so dashboards and alerts stay fast. The example below records the error ratio for a checkout service over several windows, using a request counter labelled with the HTTP status code. Metric and label names depend on your instrumentation.
groups:
- name: checkout-slo
rules:
- record: slo:checkout_errors:ratio_rate5m
expr: |
sum(rate(http_requests_total{service="checkout", code=~"5.."}[5m]))
/
sum(rate(http_requests_total{service="checkout"}[5m]))
- record: slo:checkout_errors:ratio_rate1h
expr: |
sum(rate(http_requests_total{service="checkout", code=~"5.."}[1h]))
/
sum(rate(http_requests_total{service="checkout"}[1h]))
Decide what counts as a valid event. Health checks, requests from internal probes and client errors caused by bad input (many 4xx codes) are often excluded so they do not distort the SLI.
Alerting on error budget burn
The SRE workbook defines burn rate as how fast, relative to the SLO, the service consumes the error budget. A burn rate of 1 uses exactly the whole budget by the end of the SLO window. Alerting on burn rate pages people when the budget is genuinely at risk and ignores brief blips that do not matter.
For a 99.9 percent SLO, the workbook recommends these multiwindow, multi-burn-rate settings:
| Budget consumed | Long window | Short window | Burn rate | Action |
|---|---|---|---|---|
| 2% | 1 hour | 5 minutes | 14.4 | Page |
| 5% | 6 hours | 30 minutes | 6 | Page |
| 10% | 3 days | 6 hours | 1 | Ticket |
The short window makes the alert stop soon after the problem is fixed. A Prometheus alert for the first row looks like this, where 0.001 is the error budget for 99.9 percent:
- alert: CheckoutErrorBudgetFastBurn
expr: |
slo:checkout_errors:ratio_rate1h > (14.4 * 0.001)
and
slo:checkout_errors:ratio_rate5m > (14.4 * 0.001)
labels:
severity: page
annotations:
summary: "Checkout is burning its 30-day error budget quickly"
Using SLO alerts as the main paging signal also cuts noise, because you page on user impact instead of on every component metric.
From SLO alert to root cause
When a burn-rate alert fires, the responder needs to answer three questions quickly.
- Who is affected? Break the SLI down by endpoint, region, version and customer tier. If only one region or the newest version is failing, the cause is already narrowed.
- Where in the request path? Open slow or failed traces from the affected slice and look for the span that holds the time or the error: a database call, a downstream service, a third-party API.
- Why? Read the logs for that span's service, filtered by trace ID, to see the error message, timeout or bad input.
Change events belong on the same dashboards. A deploy marker at the start of the burn is often the fastest clue. Which signal tends to answer which question fastest is covered in logs, metrics or traces: fastest incident insight.
Error budgets as a decision tool
The error budget turns reliability into a shared number between product and engineering. When budget remains, teams can ship faster and take more risk. When it is nearly spent, they slow releases and fix reliability work first. That only works if everyone trusts the SLI, which is why measurement quality matters so much. Read why SRE error budgets matter for the policy side and who should define error budgets for ownership.
Instrumentation with OpenTelemetry
OpenTelemetry provides vendor-neutral APIs, SDKs and a Collector for traces, metrics and logs. It lets you instrument once and send data to whichever backend you choose. Its status page shows that maturity varies: traces are stable in most language SDKs, metrics in many, and logs in fewer, with several languages still in development. Check the status for your language before you standardize on it for all three signals.
Whichever SDK you use, agree on resource attributes such as service name, version and deployment environment so the SLI, traces and logs line up by the same labels.
SLOs for dependencies and pipelines
User-facing SLOs depend on everything behind them. If checkout calls a payment service, a fraud check and a database, each of those needs its own indicator, even if only the checkout SLO is published. Internal SLOs for dependencies let the owning teams see how much of the user-facing error budget they consume, and traces make that visible request by request.
Batch and data pipelines need SLOs too, but the indicators differ. Freshness (how old is the newest data a reader sees) and completion (what share of runs finish before their deadline) usually matter more than request latency. Emit a metric when each run starts and finishes, and log the reason for every failed run, so the SLI and its diagnosis come from the same events.
Review dependency SLOs alongside the user-facing one. When a downstream team keeps spending most of the budget, that is a prioritization conversation backed by data rather than a complaint.
Common mistakes
- SLIs measured from server CPU or uptime checks rather than user requests.
- Too many SLOs, so none of them drive decisions.
- Targets copied from current performance, which the SRE book warns can lock in unsustainable effort.
- Starting with a very strict target. The book suggests starting looser and tightening over time.
- Paging on every threshold breach instead of on budget burn.
- Traces and logs without shared IDs or labels, so the responder cannot move from the alert to the cause.
A rollout plan
- Pick one user journey, such as checkout or login, and define an availability and a latency SLI for it.
- Measure them from gateway or load balancer data and record them with recording rules.
- Set a 30-day SLO slightly below current performance and publish the error budget.
- Add the burn-rate alerts from the table above and retire overlapping threshold alerts.
- Make sure traces and logs carry trace IDs and shared labels, and link them from the SLO dashboard.
- Agree an error budget policy with product and review it monthly.
For tooling choices, see 12 SLA and SLO monitoring tools and Prometheus and Grafana together. Hands-on practice with recording rules, alerts and dashboards is part of the Prometheus and Grafana training, offered in the Kharadi, Pune classroom and live online for other cities.
Frequently asked questions
What is the difference between an SLI and an SLO?
An SLI is a measurement of service level, such as the share of successful requests. An SLO is the target for that measurement over a time window, such as 99.9 percent successful requests over 30 days.
Why do SLOs need observability and not just monitoring?
Monitoring tells you a known check failed. Observability lets you measure the SLI from real user requests and break failures down by endpoint, region, version and dependency, which is what you need to protect the error budget.
What is an error budget burn rate?
Burn rate is how fast the service consumes its error budget relative to the SLO. A burn rate of 1 uses exactly the whole budget by the end of the window; a burn rate of 14.4 would use 2 percent of a 30-day budget in one hour.
What burn-rate alerts does Google recommend?
For a 99.9 percent SLO, the SRE workbook suggests paging at burn rate 14.4 over 1 hour with a 5-minute short window, paging at 6 over 6 hours with a 30-minute window, and a ticket at 1 over 3 days with a 6-hour window.
Should latency SLIs use averages?
No. Averages hide slow outliers. Use percentiles or, better, the share of requests faster than a threshold, which fits the good-events-over-valid-events model used for error budgets.
How do traces help when an SLO is burning?
Traces show the path of a failing or slow request across services, so you can see which span, such as a database call or downstream API, holds the error or the latency.
Can OpenTelemetry handle all three signals?
OpenTelemetry covers traces, metrics and logs, but stability differs by language SDK. Traces are stable in most SDKs, while logs are still in development for several languages, so check the status page for yours.
References
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0