Setting SLO targets isn't about picking arbitrary high percentages; it's fundamentally about understanding and meeting your users' expectations for your service. Aiming for 100% availability or sub-millisecond latency for every component is almost always an overspend, leading to wasted resources and engineering effort. Instead, the goal is to find the "sweet spot" of reliability where users are generally satisfied, and the business impact of potential downtime is acceptable, without incurring excessive development and infrastructure costs. This requires a shift from an engineering-centric view to a user-centric perspective, asking not just "can we make it faster?" but "how fast does it need to be for our users to be happy?".
To practically align SLO targets with user expectations, begin by mapping critical user journeys. Identify the core actions users perform and which parts of your service support them. Gather data: analyze support tickets to see what users complain about most frequently (e.g., slow logins, failed checkouts), conduct user surveys, or even A/B test different reliability levels if feasible. Consider your competitors – what level of service do they provide? Equally important is understanding the business impact of downtime for these critical paths. If an e-commerce checkout failure costs thousands per minute, your reliability target for that flow will be much higher than for a rarely accessed administrative report.
Once you have a clear picture of user expectations and business impact, you can translate these qualitative insights into concrete, measurable SLO targets. For example, if users frequently complain about slow page loads on your main dashboard, you might set an SLO for "99% of dashboard requests to complete within 500ms over a 28-day window." This target directly addresses the user pain point and is achievable without chasing an unrealistic 100%. Remember, these targets aren't set in stone; they should be revisited and adjusted as user expectations evolve, your product changes, or your understanding of the service's performance deepens.
Key Takeaways
- Don't chase 100% reliability; aim for the "sweet spot" that balances user satisfaction and cost.
- Map critical user journeys and analyze user feedback (support tickets, surveys) to identify pain points.
- Understand the business impact of unreliability to justify investment in higher SLOs.
- Translate qualitative user expectations into specific, measurable SLO targets (e.g., latency, availability).
- SLO targets are dynamic and should be re-evaluated as products and user expectations change.
Code Example
sli:
name: "Login Success Rate"
description: "Percentage of successful user login attempts."
metric_source: "prometheus"
query: "sum(rate(login_requests_total{status='success'}[5m])) / sum(rate(login_requests_total[5m]))"
slo:
name: "User Login Availability"
time_window: "28d"
objective: "99.9%"
sli_ref: "Login Success Rate"How this code works
This code snippet defines a Service Level Indicator (SLI) and a Service Level Objective (SLO) for user logins. Its job is to establish how to measure the reliability of login attempts and then set a target for that reliability, ensuring a consistent user experience.
The sli block first defines "Login Success Rate" as the specific metric to track. Its query is a Prometheus expression that calculates the percentage of successful login requests out of all login attempts over a rolling five-minute period. This query precisely measures the proportion of 'good' login events. A subtle but important detail is the use of rate in the Prometheus query, which calculates the per-second average rate of increase for a counter. This ensures the SLI measures the success rate of recent events, not just potentially stale or cumulative counter values. Subsequently, the slo block sets the "User Login Availability" objective. It links to the "Login Success Rate" sli_ref and mandates an objective of "99.9%" success, measured over a time_window of "28d". This means the system aims for at least 99.9% successful logins over any given 28-day period.