Prometheus: List Rules
prometheus_list_rulesLists Prometheus alerting and recording rules with PromQL, health, and state; filter by health=err to catch failing rules before alerts silently stop firing.
Instructions
List alerting and recording rules with their PromQL, health and state. Use health=err to find rules that fail to evaluate (their lastError says why) — a broken alert rule never fires, which looks exactly like everything being fine. Use type=record to find a recording rule's name before querying it, since a precomputed series is far cheaper than recomputing it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Only alerting or only recording rules. Defaults to any. | any |
| group | No | Only rules in this rule group, by exact name. | |
| limit | No | Maximum rules to return (1-1000). Defaults to 50. | |
| state | No | Only alerting rules in this state. Defaults to any. | any |
| health | No | Only rules with this evaluation health. err = the last evaluation failed. | any |
| search | No | Case-insensitive substring matched against rule name, group and query, e.g. a metric name. | |
| include_query | No | Include each rule's PromQL. false roughly halves the size when only names are needed. |