What are SLIs, SLOs, and SLAs and how do they relate to monitoring?
Learn what SLIs, SLOs, and SLAs mean, how they differ, and how error budgets and Prometheus metrics connect them to real service reliability.
Expected Interview Answer
An SLI is a measured indicator of service behavior (like request latency or availability), an SLO is the internal target you set for that indicator (like 99.9% success), and an SLA is the external contract with customers that carries consequences if the target is missed.
SLIs are the raw signals you compute from monitoring data, often in Prometheus using PromQL over success and error counters. SLOs turn those signals into goals over a time window and give you an error budget — the amount of failure you can tolerate before action is required. SLAs wrap an SLO in a formal, usually contractual promise with penalties. The relationship is a hierarchy: SLIs measure, SLOs target, SLAs enforce, and monitoring is what makes all three observable and actionable.
- Ties monitoring directly to user experience
- Error budgets balance reliability against feature velocity
- SLOs give teams objective, shared targets
- SLAs set clear customer expectations
- Alerting on SLO burn rate reduces noise
AI Mentor Explanation
The SLI is like a batter's measured strike rate ball by ball. The SLO is the team's internal target — say keep the run rate above six for the innings. The SLA is the sponsorship clause promising fans an attacking brand of play, with refunds if the season falls flat. Measurement, internal goal, and external promise stacked in order.
Step-by-Step Explanation
Step 1
Pick an SLI
Choose a meaningful indicator such as availability or latency computed from real signals.
Step 2
Compute it in Prometheus
Use PromQL over success and total counters to produce the ratio over a window.
Step 3
Set an SLO
Define a target like 99.9% over 30 days, which implies an error budget.
Step 4
Track the error budget
Alert on burn rate so you act before the SLO is breached.
Step 5
Wrap into an SLA
Formalize the customer-facing promise, usually looser than the internal SLO, with consequences.
What Interviewer Expects
- SLI measures, SLO targets, SLA is the contract
- Understanding of error budgets
- SLAs are usually looser than SLOs
- How to compute SLIs from Prometheus metrics
- Burn-rate alerting concept
Common Mistakes
- Using SLI, SLO, and SLA interchangeably
- Setting the SLA tighter than the SLO
- Choosing SLIs that don't reflect user experience
- Ignoring the error budget when prioritizing work
Best Answer (HR Friendly)
“An SLI is the actual measurement of how a service is doing, an SLO is the goal you set for that measurement, and an SLA is the formal promise to customers with penalties if you miss it. Monitoring tools like Prometheus produce the measurements that make all three possible.”
Code Example
# SLI: success ratio over 30 days
sum(rate(http_requests_total{status!~"5.."}[30d]))
/ sum(rate(http_requests_total[30d]))
# Error budget remaining for a 99.9% SLO
1 - (
(1 - (sum(rate(http_requests_total{status!~"5.."}[30d]))
/ sum(rate(http_requests_total[30d]))))
/ 0.001
)Follow-up Questions
- What is an error budget and how is it used?
- Why is an SLA usually looser than an SLO?
- How would you choose good SLIs for a service?
- What is burn-rate alerting?
- How do error budgets influence release decisions?
MCQ Practice
1. Which of these is the external, contractual promise?
An SLA is the formal agreement with customers, typically carrying penalties for breaches.
2. An SLI is best described as?
An SLI (Service Level Indicator) is a quantitative measurement of a service aspect like latency.
3. What does an SLO imply that helps balance reliability and velocity?
An SLO defines an allowable amount of failure, the error budget, which teams spend on changes.
Flash Cards
What is an SLI? — A measured indicator of service behavior, like availability or latency.
What is an SLO? — An internal target for an SLI over a window, implying an error budget.
What is an SLA? — An external, usually contractual promise with consequences for missing it.
SLA vs SLO tightness? — The SLA is usually looser than the internal SLO to leave safety margin.