Interview Prep/SRE & Reliability/Prometheus SLIs & Recording Rules

The SLI ratio is above 1.0 (or the latency "good" ratio is 1.07).

IntermediateTroubleshootingPrometheus SLIs & Recording Rules
Answer

Likely causes → Numerator and denominator select different series: the good-events query includes a job, route, or instance that the total does not, or they come from different metrics with different label filters.

Diagnose → Compare label selectors character by character, and check counts:

count(http_request_duration_seconds_bucket{le="0.3"})
count(http_request_duration_seconds_count)

Fix → Use identical selectors on both sides, and for latency use _bucket{le=X} and _count of the same histogram.

Prevent → Generate rules from one SLO spec (Sloth/Pyrra) and add a promtool unit test asserting the ratio stays within 0 to 1.

All SRE & Reliability questions Roadmap: SRE & incident response

More on Prometheus SLIs & Recording Rules