PrometheusRule [prometheusrules.monitoring.coreos.com/v1]
- Description
- The `PrometheusRule` custom resource definition (CRD) defines [alerting](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/) and [recording](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/) rules to be evaluated by `Prometheus` or `ThanosRuler` objects. `Prometheus` and `ThanosRuler` objects select `PrometheusRule` objects using label and namespace selectors.
- Type
object- Required
spec
Specification
.spec
- Description
- Specification of desired alerting rule definitions for Prometheus.
- Type
object
.spec.groups
- Description
- Content of Prometheus rule file
- Type
array
.spec.groups[]
- Description
- RuleGroup is a list of sequentially evaluated recording and alerting rules.
- Type
object- Required
name
.spec.groups[].labels
- Description
- 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.
- Type
object
.spec.groups[].rules
- Description
- List of alerting and recording rules.
- Type
array
.spec.groups[].rules[]
- Description
- Rule describes an alerting or recording rule See Prometheus documentation: [alerting](https://www.prometheus.io/docs/prometheus/latest/configuration/alerting_rules/) or [recording](https://www.prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules) rule
- Type
object- Required
expr
.spec.groups[].rules[].annotations
- Description
- Annotations to add to each alert. Only valid for alerting rules.
- Type
object
.spec.groups[].rules[].labels
- Description
- Labels to add or overwrite.
- Type
object
API Endpoints
The following API endpoints are available:
/apis/monitoring.coreos.com/v1/namespaces/{namespace}/prometheusrulesDELETE: delete collection of PrometheusRuleGET: list objects of kind PrometheusRulePOST: create a new PrometheusRule
/apis/monitoring.coreos.com/v1/namespaces/{namespace}/prometheusrules/{name}DELETE: delete the specified PrometheusRuleGET: read the specified PrometheusRulePATCH: partially update the specified PrometheusRulePUT: replace the specified PrometheusRule
/apis/monitoring.coreos.com/v1/namespaces/{namespace}/prometheusrules
- HTTP method
DELETE- Description
- delete collection of PrometheusRule
- HTTP responses
- HTTP method
GET- Description
- list objects of kind PrometheusRule
- HTTP responses
- HTTP method
POST- Description
- create a new PrometheusRule
- Query parameters
- Body parameters
- HTTP responses
/apis/monitoring.coreos.com/v1/namespaces/{namespace}/prometheusrules/{name}
- HTTP method
DELETE- Description
- delete the specified PrometheusRule
- Query parameters
- HTTP responses
- HTTP method
GET- Description
- read the specified PrometheusRule
- HTTP responses
- HTTP method
PATCH- Description
- partially update the specified PrometheusRule
- Query parameters
- HTTP responses
- HTTP method
PUT- Description
- replace the specified PrometheusRule
- Query parameters
- Body parameters
- HTTP responses