Skip to content

Commit 50a9341

Browse files
authored
Merge pull request #48346 from windsonsea/metricy
[zh] Sync cluster-administration/system-metrics.md
2 parents 63041ae + 20d8b89 commit 50a9341

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

content/zh-cn/docs/concepts/cluster-administration/system-metrics.md

+20-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: Kubernetes 系统组件指标
33
content_type: concept
44
weight: 70
55
---
6-
76
<!--
87
title: Metrics For Kubernetes System Components
98
reviewers:
@@ -96,6 +95,7 @@ Alpha metric → Stable metric → Deprecated metric → Hidden metric → De
9695
Alpha metrics have no stability guarantees. These metrics can be modified or deleted at any time.
9796
9897
Stable metrics are guaranteed to not change. This means:
98+
9999
* A stable metric without a deprecated signature will not be deleted or renamed
100100
* A stable metric's type will not be modified
101101
@@ -263,6 +263,7 @@ lack of resources, and compare actual usage to the pod's request.
263263
The kube-scheduler identifies the resource [requests and limits](/docs/concepts/configuration/manage-resources-containers/)
264264
configured for each Pod; when either a request or limit is non-zero, the kube-scheduler reports a
265265
metrics timeseries. The time series is labelled by:
266+
266267
- namespace
267268
- pod name
268269
- the node where the pod is scheduled or an empty string if not yet scheduled
@@ -275,6 +276,7 @@ kube-scheduler 组件能够辩识各个 Pod 所配置的资源
275276
[请求和约束](/zh-cn/docs/concepts/configuration/manage-resources-containers/)
276277
在 Pod 的资源请求值或者约束值非零时,kube-scheduler 会以度量值时间序列的形式
277278
生成报告。该时间序列值包含以下标签:
279+
278280
- 名字空间
279281
- Pod 名称
280282
- Pod 调度所处节点,或者当 Pod 未被调度时用空字符串表示
@@ -291,7 +293,7 @@ The two metrics are called `kube_pod_resource_request` and `kube_pod_resource_li
291293
292294
The metrics are exposed at the HTTP endpoint `/metrics/resources` and require the same
293295
authorization as the `/metrics` endpoint on the scheduler. You must use the
294-
`-show-hidden-metrics-for-version=1.20` flag to expose these alpha stability metrics.
296+
`--show-hidden-metrics-for-version=1.20` flag to expose these alpha stability metrics.
295297
-->
296298
一旦 Pod 进入完成状态(其 `restartPolicy``Never``OnFailure`,且
297299
其处于 `Succeeded``Failed` Pod 阶段,或者已经被删除且所有容器都具有
@@ -320,26 +322,33 @@ disabled metrics (i.e. `--disabled-metrics=metric1,metric2`).
320322
## Metric cardinality enforcement
321323
322324
Metrics with unbounded dimensions could cause memory issues in the components they instrument. To
323-
limit resource use, you can use the `--allow-label-value` command line option to dynamically
325+
limit resource use, you can use the `--allow-metric-labels` command line option to dynamically
324326
configure an allow-list of label values for a metric.
327+
328+
In alpha stage, the flag can only take in a series of mappings as metric label allow-list.
329+
Each mapping is of the format `<metric_name>,<label_name>=<allowed_labels>` where
330+
`<allowed_labels>` is a comma-separated list of acceptable label names.
325331
-->
326332
## 指标顺序性保证 {#metric-cardinality-enforcement}
327333

328-
在 Alpha 阶段,标志只能接受一组映射值作为可以使用的指标标签。
334+
具有无限维度的指标可能会在其监控的组件中引起内存问题。
335+
为了限制资源使用,你可以使用 `--allow-metric-labels` 命令行选项来为指标动态配置允许的标签值列表。
336+
337+
在 Alpha 阶段,此选项只能接受一组映射值作为可以使用的指标标签。
329338
每个映射值的格式为`<指标名称>,<标签名称>=<可用标签列表>`,其中
330339
`<可用标签列表>` 是一个用逗号分隔的、可接受的标签名的列表。
331340

332341
<!--
333342
The overall format looks like:
334343
335344
```
336-
--allow-label-value <metric_name>,<label_name>='<allow_value1>, <allow_value2>...', <metric_name2>,<label_name>='<allow_value1>, <allow_value2>...', ...
345+
--allow-metric-labels <metric_name>,<label_name>='<allow_value1>, <allow_value2>...', <metric_name2>,<label_name>='<allow_value1>, <allow_value2>...', ...
337346
```
338347
-->
339348
最终的格式看起来会是这样:
340349

341350
```
342-
--allow-label-value <指标名称>,<标签名称>='<可用值1>,<可用值2>...', <指标名称2>,<标签名称>='<可用值1>, <可用值2>...', ...
351+
--allow-metric-labels <指标名称>,<标签名称>='<可用值1>,<可用值2>...', <指标名称2>,<标签名称>='<可用值1>, <可用值2>...', ...
343352
```
344353

345354
<!--
@@ -348,7 +357,7 @@ Here is an example:
348357
下面是一个例子:
349358

350359
```none
351-
--allow-label-value number_count_metric,odd_number='1,3,5', number_count_metric,even_number='2,4,6', date_gauge_metric,weekend='Saturday,Sunday'
360+
--allow-metric-labels number_count_metric,odd_number='1,3,5', number_count_metric,even_number='2,4,6', date_gauge_metric,weekend='Saturday,Sunday'
352361
```
353362

354363
<!--
@@ -361,9 +370,8 @@ line argument to a component. Here's an example of the contents of that configur
361370
以下是该配置文件的内容示例:
362371

363372
```yaml
364-
allow-list:
365-
- "metric1,label2": "v1,v2,v3"
366-
- "metric2,label1": "v1,v2,v3"
373+
"metric1,label2": "v1,v2,v3"
374+
"metric2,label1": "v1,v2,v3"
367375
```
368376
369377
<!--
@@ -379,7 +387,9 @@ is encountered that is not allowed with respect to the allow-list constraints.
379387
<!--
380388
* Read about the [Prometheus text format](https://github.com/prometheus/docs/blob/master/content/docs/instrumenting/exposition_formats.md#text-based-format)
381389
for metrics
390+
* See the list of [stable Kubernetes metrics](https://github.com/kubernetes/kubernetes/blob/master/test/instrumentation/testdata/stable-metrics-list.yaml)
382391
* Read about the [Kubernetes deprecation policy](/docs/reference/using-api/deprecation-policy/#deprecating-a-feature-or-behavior)
383392
-->
384393
* 阅读有关指标的 [Prometheus 文本格式](https://github.com/prometheus/docs/blob/master/content/docs/instrumenting/exposition_formats.md#text-based-format)
394+
* 参阅[稳定的 Kubernetes 指标](https://github.com/kubernetes/kubernetes/blob/master/test/instrumentation/testdata/stable-metrics-list.yaml)的列表
385395
* 阅读有关 [Kubernetes 弃用策略](/zh-cn/docs/reference/using-api/deprecation-policy/#deprecating-a-feature-or-behavior)

0 commit comments

Comments
 (0)