第 7 章 PrometheusRule [monitoring.coreos.com/v1]


描述
PrometheusRule 为 Prometheus 实例定义记录和警报规则
类型
object
必填
  • spec

7.1. 规格

Expand
属性类型描述

apiVersion

string

APIVersion 定义对象的这个表示法的版本化的 schema。服务器应该将识别的模式转换为最新的内部值,并可拒绝未识别的值。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

kind

string

kind 是一个字符串值,代表此对象所代表的 REST 资源。服务器可以从客户端向其提交请求的端点推断。无法更新。采用驼峰拼写法 (CamelCase)。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

metadata

ObjectMeta

标准对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

spec

对象

Prometheus 所需的警报规则定义的规格。

7.1.1. .spec

描述
Prometheus 所需的警报规则定义的规格。
类型
object
Expand
属性类型描述

groups

array

Prometheus 规则文件的内容

groups[]

对象

RuleGroup 是按顺序评估的记录和警报规则的列表。注: PartialResponseStrategy 仅供 ThanosRuler 使用,Prometheus 实例会忽略它。此字段的有效值为 'warn' 或 'abort'。更多信息: https://github.com/thanos-io/thanos/blob/main/docs/components/rule.md#partial-response

7.1.2. .spec.groups

描述
Prometheus 规则文件的内容
类型
array

7.1.3. .spec.groups[]

描述
RuleGroup 是按顺序评估的记录和警报规则的列表。注: PartialResponseStrategy 仅供 ThanosRuler 使用,Prometheus 实例会忽略它。此字段的有效值为 'warn' 或 'abort'。更多信息: https://github.com/thanos-io/thanos/blob/main/docs/components/rule.md#partial-response
类型
object
必填
  • name
  • rules
Expand
属性类型描述

interval

字符串

 

name

字符串

 

partial_response_strategy

字符串

 

rules

array

 

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)规则

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
Expand
属性类型描述

alert

字符串

 

annotations

对象(字符串)

 

Expr

integer-or-string

 

对于

字符串

 

labels

对象(字符串)

 

记录

字符串

 
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat