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

`promtool test rules` reports `FAILED: alertname: CheckoutErrorBudgetBurnFast, time: 10m, exp:[0: Labels:{alertname="CheckoutErrorBudgetBurnFast", severity="page"}], got:[]`.

IntermediateTroubleshootingPrometheus SLIs & Recording Rules
Answer

Likely causes → At eval_time: 10m the alert is not yet firing: the input series do not have enough history for the [1h] window to exceed the threshold, the for: duration has not elapsed, or the expected labels miss labels the rule adds (like slo).

Diagnose → Evaluate the recording rules at that time in the test with promql_expr_test, and print what the alert produces at later times.

Fix → Move eval_time later (after the long window is above threshold plus for:), increase the error ratio in input_series, and list every label in exp_labels, including ones from recording rules.

Prevent → Keep a positive and a negative test case per alert tier, and document expected detection time in the test.

All SRE & Reliability questions Roadmap: SRE & incident response

More on Prometheus SLIs & Recording Rules