Choose an SLI for a REST API: availability measured at the pod, the load balancer, or the client?
IntermediateScenarioSLOs and Error Budgets
Answer
Situation read → The closer to the user, the more accurate, but the harder to measure.
What I'd do →
- Use the load balancer or ingress as the primary source: it captures requests that never reached pods (5xx from LB, no healthy targets).
- Add synthetic probes for coverage during low traffic.
- Use client-side RUM data for web/mobile journeys where possible.
- Avoid pod-level metrics alone; they miss failures before the app.
sum(rate(nginx_ingress_controller_requests{ingress="api",status!~"5.."}[5m]))
/
sum(rate(nginx_ingress_controller_requests{ingress="api"}[5m]))
Why → An SLI that cannot see failures cannot protect users.
Interview tip → Mention what counts as "valid": usually exclude 4xx caused by clients.
More on SLOs and Error Budgets
Your company has no SLOs. A VP asks you to introduce them. Where do you begin?BeginnerThe product owner wants a 99.99% SLO for a service that depends on a database with 99.95% availability. What do you say?IntermediateThe error budget for the month is exhausted on day 18. What happens now?IntermediateWrite an SLO in a declarative tool so teams do not hand-write burn-rate rules.AdvancedLatency SLO: "99% of requests under 300 ms." How do you measure it correctly in Prometheus?IntermediateA service has 20 requests per hour overnight. One failure blows the SLO alert. How do you handle low-traffic services?Advanced