promtool check rules
promtool check rules <rules.yml>
Risk: Safe
What it does
Checks a rule file: the YAML, every expr, and every name.
When to use it
Before you load new recording or alerting rules.
Example
$ docker compose exec prometheus promtool check rules /etc/prometheus/rules.ymlSUCCESS: 1 rules found. A broken expr shows the parse error and the line.
Learn it in: Recording rules · Official docs