Defining SLI Specifications
You'll learn how to translate high-level reliability goals into precise, measurable SLI definitions with explicit data sources, calculation methods, and time windows.
What Is an SLI Specification?
An SLI specification is the implementation blueprint for measuring service level indicators. While an SLI describes what you measure (like "request latency"), the specification defines exactly how you measure it—down to the query, threshold, and evaluation window.
Think of it like a recipe: saying "bake a cake" isn't enough. You need exact ingredients, temperatures, and timing. Similarly, "measure availability" needs a precise specification to be actionable.
Core Components of an SLI Specification
Data Source
Where does the measurement come from? Common sources include:
- Application metrics (Prometheus counters, histograms)
- Load balancer logs (successful vs. failed requests)
- Synthetic monitors (external probes)
- Distributed traces (span success rates)
Calculation Method
How do you compute the SLI value? For request-based SLIs:
- Formula:
(good requests / total requests) × 100 - Definition of "good": Response code 2xx or 3xx AND latency < 500ms
- Exclusion criteria: Health checks, non-production traffic
For window-based SLIs, you might measure uptime percentage across fixed intervals.
Time Window
Over what period do you aggregate? Options include:
- Rolling windows (last 30 days)
- Calendar-aligned windows (monthly)
- Evaluation intervals (1-minute, 5-minute buckets)
Example Specification
SLI: HTTP request availability
Source: nginx_ingress_controller_requests_total
Good events: status=~"2..|3.."
Total events: all requests to /api/*
Window: 30-day rolling
Target: 99.9%
Key Takeaway: A complete SLI specification removes all ambiguity by documenting the exact data source, calculation formula, success criteria, and measurement window—turning abstract reliability goals into concrete, reproducible measurements.