Interview Prep/Monitoring & Observability/PromQL and recording rules

Recording rule never produces data; `/rules` shows health `err` with `vector contains metrics with the same labelset after applying rule labels`

AdvancedTroubleshootingPromQL and recording rules
Answer

Likely causes → The expression returns several series that become identical once __name__ is replaced and rule labels: are applied (e.g. rate(x[5m]) across two jobs then a job label is overwritten).

Diagnose → Run the expression in the UI; check which labels differ between series.

Fix → Aggregate explicitly: sum by (service) (...) so output labels are unique, or stop overwriting a distinguishing label.

Prevent → Lint rules with promtool check rules and unit-test them with promtool test rules.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on PromQL and recording rules