第 7 章 PrometheusRule [monitoring.coreos.com/v1]
- 描述
- PrometheusRule 为 Prometheus 实例定义记录和警报规则
- 类型
-
object
- 必填
-
spec
-
7.1. 规格
属性 | 类型 | 描述 |
---|---|---|
|
| APIVersion 定义对象的这个表示法的版本化的 schema。服务器应该将识别的模式转换为最新的内部值,并可拒绝未识别的值。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
| kind 是一个字符串值,代表此对象所代表的 REST 资源。服务器可以从客户端向其提交请求的端点推断。无法更新。采用驼峰拼写法 (CamelCase)。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| 标准对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | |
|
| Prometheus 所需的警报规则定义的规格。 |
7.1.1. .spec
- 描述
- Prometheus 所需的警报规则定义的规格。
- 类型
-
object
属性 | 类型 | 描述 |
---|---|---|
|
| Prometheus 规则文件的内容 |
|
| RuleGroup 是按顺序评估的记录和警报规则的列表。 |
7.1.2. .spec.groups
- 描述
- Prometheus 规则文件的内容
- 类型
-
array
7.1.3. .spec.groups[]
- 描述
- RuleGroup 是按顺序评估的记录和警报规则的列表。
- 类型
-
object
- 必填
-
name
-
rules
-
属性 | 类型 | 描述 |
---|---|---|
|
| 间隔决定了组中规则的频率。 |
|
| 规则组的名称。 |
|
| PartialResponseStrategy 仅供 ThanosRuler 使用,Prometheus 实例会忽略它。更多信息: https://github.com/thanos-io/thanos/blob/main/docs/components/rule.md#partial-response |
|
| 警报和记录规则列表。 |
|
| 规则描述了警报或记录规则,请参阅 Prometheus 文档: [alerting](https://www.prometheus.io/docs/prometheus/latest/configuration/alerting_rules/)或 [recording](https://www.prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules)规则 |
7.1.4. .spec.groups[].rules
- 描述
- 警报和记录规则列表。
- 类型
-
array
7.1.5. .spec.groups[].rules[]
- 描述
- 规则描述了警报或记录规则,请参阅 Prometheus 文档: [alerting](https://www.prometheus.io/docs/prometheus/latest/configuration/alerting_rules/)或 [recording](https://www.prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules)规则
- 类型
-
object
- 必填
-
Expr
-
属性 | 类型 | 描述 |
---|---|---|
|
|
警报的名称。必须是有效的标签值。只能设置其中一个 |
|
| 要添加到每个警报的注解。仅对警报规则有效。 |
|
| 要评估的 PromQL 表达式。 |
|
| 当警报在此长时间返回后,会被视为触发。 |
|
| 要添加或覆盖的标签。 |
|
|
要输出的时间序列名称。必须是有效的指标名称。只能设置其中一个 |