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

`promtool check rules` fails with `could not parse expression: 1:72: parse error: unexpected right parenthesis ')'`.

BeginnerTroubleshootingPrometheus SLIs & Recording Rules
Answer

Likely causes → Unbalanced parentheses or braces in a multi-line PromQL expression, often after editing a long burn-rate and/or expression, or YAML folding (>) joining lines in an unexpected way.

Diagnose →

promtool check rules slo-rules.yaml
promtool query instant http://localhost:9090 '<paste the expression>'

The 1:72 is line:column inside the expression, not the YAML file.

Fix → Use the literal block scalar | for multi-line expressions, align parentheses one level per line, and test the expression in the Prometheus UI first.

Prevent → Run promtool check rules and promtool test rules in CI on every change; generate SLO rules with Sloth or Pyrra instead of hand-editing.

All SRE & Reliability questions Roadmap: SRE & incident response

More on Prometheus SLIs & Recording Rules