PrometheusRule [prometheusrules.monitoring.coreos.com/v1]

monitoring.coreos.comgroup

The PrometheusRule custom resource definition (CRD) defines alerting and recording rules to be evaluated by Prometheus or ThanosRuler objects.

Prometheus and ThanosRuler objects select PrometheusRule objects using label and namespace selectors.

v1version
specobjectrequired

Specification of desired alerting rule definitions for Prometheus.

groups[]object

RuleGroup is a list of sequentially evaluated recording and alerting rules.

intervalstring

Interval determines how often rules in the group are evaluated.

labelsobject

Labels to add or overwrite before storing the result for its rules. The labels defined at the rule level take precedence.

It requires Prometheus >= 3.0.0. The field is ignored for Thanos Ruler.

limitinteger

Limit the number of alerts an alerting rule and series a recording rule can produce. Limit is supported starting with Prometheus >= 2.31 and Thanos Ruler >= 0.24.

namestringrequired

Name of the rule group.

partial_response_strategystring

PartialResponseStrategy is only used by ThanosRuler and will be ignored by Prometheus instances. More info: https://github.com/thanos-io/thanos/blob/main/docs/components/rule.md#partial-response

query_offsetstring

Defines the offset the rule evaluation timestamp of this particular group by the specified duration into the past.

It requires Prometheus >= v2.53.0. It is not supported for ThanosRuler.

rules[]object

Rule describes an alerting or recording rule See Prometheus documentation: alerting or recording rule

alertstring

Name of the alert. Must be a valid label value. Only one of record and alert must be set.

annotationsobject

Annotations to add to each alert. Only valid for alerting rules.

exprrequired

PromQL expression to evaluate.

forstring

Alerts are considered firing once they have been returned for this long.

keep_firing_forstring

KeepFiringFor defines how long an alert will continue firing after the condition that triggered it has cleared.

labelsobject

Labels to add or overwrite.

recordstring

Name of the time series to output to. Must be a valid metric name. Only one of record and alert must be set.