`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.
More on Prometheus SLIs & Recording Rules
You applied a `PrometheusRule` for your SLO, but `slo:sli_error:ratio_rate5m` returns nothing in Prometheus.BeginnerThe availability SLI panel shows `NaN` every night between 02:00 and 05:00.BeginnerYour per-route SLI query fails with `found duplicate series for the match group {route="/api/checkout"} on the right hand-side of the operation`.IntermediatePrometheus logs `vector contains metrics with the same labelset after applying rule labels` for your SLI recording rule.AdvancedYour latency SLI using `le="0.3"` returns an empty result, but the histogram exists.IntermediateThe SLI ratio is above 1.0 (or the latency "good" ratio is 1.07).Intermediate