monitoring.gdc.goog/v1
包含 Monitoring 组的 API 架构定义。
AlertRule
定义提醒规则配置。
来源: - MonitoringRuleSpec
| 字段 | 说明 |
|---|---|
alert 字符串 |
提醒名称。其值必须是有效的标签值。 |
expr 字符串 |
用于评估提醒规则的 PromQL 或 LogQL 表达式。 |
for 字符串 |
从待处理状态到打开状态,必须满足指定条件的时长(以秒为单位)。 |
labels 对象(键:字符串,值:字符串) |
要添加或覆盖的标签。此字段中的必需标签为 severity: [error, critical, warning, info]、code: <short code for the error> 和 resource: <component, service, or hardware related to the alert>。任何其他标签都是可选的。 |
annotations 对象(键:字符串,值:字符串) |
要添加的注释。 |
ClusterStatus
ClusterStatus 是影响特定集群的条件列表。
来源: - MonitoringTargetStatus
| 字段 | 说明 |
|---|---|
cluster 字符串 |
|
conditions 条件数组 |
MonitoringRule
定义了 Monitoring Rules API 的架构。
来源: - MonitoringRuleList
| 字段 | 说明 |
|---|---|
apiVersion 字符串 |
monitoring.gdc.goog/v1 |
kind 字符串 |
MonitoringRule |
metadata ObjectMeta |
如需了解 metadata 的字段,请参阅 Kubernetes API 文档。 |
spec MonitoringRuleSpec |
|
status MonitoringRuleStatus |
MonitoringRuleList
包含监控规则列表。
| 字段 | 说明 |
|---|---|
apiVersion 字符串 |
monitoring.gdc.goog/v1 |
kind 字符串 |
MonitoringRuleList |
metadata ListMeta |
如需了解 metadata 的字段,请参阅 Kubernetes API 文档。 |
items MonitoringRule 数组 |
MonitoringRuleSpec
定义 MonitoringRule 对象的规范或预期状态。
来源: - MonitoringRule
| 字段 | 说明 |
|---|---|
interval 字符串 |
规则评估间隔。 |
limit 整数 |
提醒数量上限。值为 0 表示没有限制。 |
recordRules RecordRule 数组 |
记录规则列表。 |
alertRules AlertRule 数组 |
提醒规则列表。 |
MonitoringRuleStatus
定义 MonitoringRule 对象的观测状态。
来源: - MonitoringRule
| 字段 | 说明 |
|---|---|
conditions 条件数组 |
定义 MonitoringRule 对象的观测状态。 |
errorStatus ErrorStatus |
ErrorStatus 包含当前错误的列表以及此字段的更新时间戳。 |
MonitoringTarget
定义监控目标 API 的架构。
来源: - MonitoringTargetList
| 字段 | 说明 |
|---|---|
apiVersion 字符串 |
monitoring.gdc.goog/v1 |
kind 字符串 |
MonitoringTarget |
metadata ObjectMeta |
如需了解 metadata 的字段,请参阅 Kubernetes API 文档。 |
spec MonitoringTargetSpec |
|
status MonitoringTargetStatus |
MonitoringTargetList
包含监控目标列表。
| 字段 | 说明 |
|---|---|
apiVersion 字符串 |
monitoring.gdc.goog/v1 |
kind 字符串 |
MonitoringTargetList |
metadata ListMeta |
如需了解 metadata 的字段,请参阅 Kubernetes API 文档。 |
items MonitoringTarget 数组 |
MonitoringTargetMetricsRelabeling
定义一个用于根据标签保留或舍弃指标的过滤条件。
来源: - MonitoringTargetPodMetricsEndpoints
| 字段 | 说明 |
|---|---|
sourceLabels 字符串数组 |
现有标签中的所选值。内容使用 separator 进行串联,并与 replace、keep 和 drop 操作的 regex 表达式进行匹配。 |
separator 字符串 |
放置在串联的来源标签值之间的分隔符值。 |
regex 字符串 |
用于匹配提取的值的正则表达式。 |
action 字符串 |
当 regex 表达式与提取的值匹配时要执行的操作。 |
targetLabel 字符串 |
在 replace 操作中写入结果值的标签。此字段对于 replace 操作是必需的。可以使用正则表达式的捕获组。 |
replacement 字符串 |
如果正则表达式与 replace 操作中提取的值匹配,则要使用的替换值。可以使用正则表达式的捕获组。 |
MonitoringTargetPodMetricsEndpoints
为被抓取的 pod 配置指标端点。
来源: - MonitoringTargetSpec
| 字段 | 说明 |
|---|---|
port MonitoringTargetPodMetricsPort |
从中抓取指标的端口。 |
path MonitoringTargetPodMetricsPath |
从中抓取指标的路径。 |
scheme MonitoringTargetPodMetricsScheme |
抓取指标时使用的方案。 |
params 对象(键:字符串,值:字符串数组) |
从 path 中抓取指标时要使用的查询参数。 |
scrapeInterval 字符串 |
Prometheus 抓取 podMetricsEndpoints 字段中定义的指标端点的频率。 |
scrapeTimeout 字符串 |
Prometheus 等待 podMetricsEndpoints 字段中定义的指标端点响应的时间。 |
metricsRelabelings MonitoringTargetMetricsRelabeling 数组 |
用于根据标签包含 (allowlist) 或排除 (denylist) 指标的过滤条件。 |
ipAddresses 字符串数组 |
IPAddress 用于配置要抓取的静态 IP 地址。 |
tlsConfig TLSConfig |
提供自定义 TLS 配置。此功能适用于需要抓取的 Kubernetes 外部工作负载。 |
authCredential 字符串 |
要提供给抓取端点的凭据。 |
MonitoringTargetPodMetricsPath
确定用于从 pod 中抓取指标的路径。
来源: - MonitoringTargetPodMetricsEndpoints
| 字段 | 说明 |
|---|---|
value 字符串 |
要从中收集指标的路径。如果提供了注释,则注释优先于此字段。 |
annotation 字符串 |
使用注解收集指标的路径。 |
MonitoringTargetPodMetricsPort
确定用于从 pod 中抓取指标的端口。
来源: - MonitoringTargetPodMetricsEndpoints
| 字段 | 说明 |
|---|---|
value 整数 |
用于收集指标的端口。如果提供了注释,则注释优先于此字段。 |
annotation 字符串 |
使用注解收集指标的端口。 |
MonitoringTargetPodMetricsScheme
确定用于从 pod 中抓取指标的方案。
来源: - MonitoringTargetPodMetricsEndpoints
| 字段 | 说明 |
|---|---|
value 字符串 |
收集指标时使用的方案。如果提供了注释,则注释优先于此字段。 |
annotation 字符串 |
使用注释收集指标时要使用的方案。 |
MonitoringTargetSelectors
提供用于确定要监控哪些 pod 的选择器。
来源: - MonitoringTargetSpec
| 字段 | 说明 |
|---|---|
matchClusters 字符串数组 |
相应作业要考虑的集群。默认配置是考虑适用于项目的所有集群。不同集群之间的关系是 OR 关系。例如,值 ["admin", "system"] 表示将管理员集群 OR 视为系统集群。 |
matchLabels 对象(键:字符串,值:字符串) |
要为此作业考虑的 pod 标签。默认配置是不考虑基于标签的过滤条件。不同配对之间的关系是 AND 关系,因此系统会考虑所有配对。 |
matchAnnotations 对象(键:字符串,值:字符串) |
相应作业要考虑的注释。默认配置是不考虑基于注释的过滤条件。不同配对之间的关系是 AND 关系,因此系统会考虑所有配对。 |
MonitoringTargetSpec
定义 MonitoringTarget 对象的规范或预期状态。
来源: - MonitoringTarget
| 字段 | 说明 |
|---|---|
selector MonitoringTargetSelectors |
用于标识相应作业的 Pod 的匹配模式。如需在不同选择器之间建立关系,请使用 AND。 |
podMetricsEndpoints MonitoringTargetPodMetricsEndpoints |
为此作业公开的端点。端点使用 Prometheus 的样式。 |
MonitoringTargetStatus
定义 MonitoringTarget 对象的观测状态。
来源: - MonitoringTarget
| 字段 | 说明 |
|---|---|
conditions 条件数组 |
监控堆栈中观察到的条件列表。 |
clusterStatuses ClusterStatus 数组 |
ClusterStatuses 是一个列表,其中包含每个集群以及在监控堆栈中观察到的相应集群的状况。 |
RecordRule
定义记录规则配置。
来源: - MonitoringRuleSpec
| 字段 | 说明 |
|---|---|
record 字符串 |
要写入记录规则的时序。必须是有效的指标名称。 |
expr 字符串 |
用于评估记录规则的 PromQL 或 LogQL 表达式。 |
labels 对象(键:字符串,值:字符串) |
要添加或覆盖的标签。 |
TLSConfig
来源: - MonitoringTargetPodMetricsEndpoints
| 字段 | 说明 |
|---|---|
ca 字符串 |
要用于目标的 CA 证书的文本。 |
cert 字符串 |
目标平台的客户端证书文件的文本。 |
server_name 字符串 |
用于验证目标的 hostname。 |