PrometheusRule [prometheusrules.monitoring.coreos.com/v1]
- 描述
- 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.
- 类型
object- 必填
spec
规格
.spec
- 描述
- Specification of desired alerting rule definitions for Prometheus.
- 类型
object
.spec.groups
- 描述
- Content of Prometheus rule file
- 类型
array
.spec.groups[]
- 描述
- RuleGroup is a list of sequentially evaluated recording and alerting rules.
- 类型
object- 必填
name
.spec.groups[].labels
- 描述
- 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.
- 类型
object
.spec.groups[].rules
- 描述
- List of alerting and recording rules.
- 类型
array
.spec.groups[].rules[]
- 描述
- 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
- 类型
object- 必填
expr
.spec.groups[].rules[].annotations
- 描述
- Annotations to add to each alert. Only valid for alerting rules.
- 类型
object
.spec.groups[].rules[].labels
- 描述
- Labels to add or overwrite.
- 类型
object
API 端点
可用的 API 端点如下:
/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 方法
DELETE- 描述
- delete collection of PrometheusRule
- HTTP 响应
- HTTP 方法
GET- 描述
- list objects of kind PrometheusRule
- HTTP 响应
- HTTP 方法
POST- 描述
- create a new PrometheusRule
- 查询参数
- 请求体参数
- HTTP 响应
/apis/monitoring.coreos.com/v1/namespaces/{namespace}/prometheusrules/{name}
- HTTP 方法
DELETE- 描述
- delete the specified PrometheusRule
- 查询参数
- HTTP 响应
- HTTP 方法
GET- 描述
- read the specified PrometheusRule
- HTTP 响应
- HTTP 方法
PATCH- 描述
- partially update the specified PrometheusRule
- 查询参数
- HTTP 响应
- HTTP 方法
PUT- 描述
- replace the specified PrometheusRule
- 查询参数
- 请求体参数
- HTTP 响应