Skip to content

Commit f9ff985

Browse files
committed
Kubelet PSI metrics documentation
1 parent e63cc33 commit f9ff985

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed

content/en/docs/concepts/cluster-administration/system-metrics.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,33 @@ ClusterRole with the `get` verb for the `/metrics/resources` non-resource URL.
177177
On Kubernetes 1.21 you must use the `--show-hidden-metrics-for-version=1.20`
178178
flag to expose these alpha stability metrics.
179179

180+
### kubelet Pressure Stall Information (PSI) metrics
181+
182+
{{< feature-state for_k8s_version="v1.33" state="alpha" >}}
183+
184+
As an alpha feature, Kubernetes lets you configure kubelet to collect Linux kernel
185+
[Pressure Stall Information](https://docs.kernel.org/accounting/psi.html)
186+
(PSI) for CPU, memory and IO usage.
187+
The information is collected at node, pod and container level.
188+
The metrics are exposed at the `/metrics/cadvisor` endpoint with the following names:
189+
190+
```
191+
container_pressure_cpu_stalled_seconds_total
192+
container_pressure_cpu_waiting_seconds_total
193+
container_pressure_memory_stalled_seconds_total
194+
container_pressure_memory_waiting_seconds_total
195+
container_pressure_io_stalled_seconds_total
196+
container_pressure_io_waiting_seconds_total
197+
```
198+
199+
You must enable the `KubeletPSI` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
200+
to use this feature. The information is also exposed in the
201+
[Summary API](/docs/reference/instrumentation/node-metrics#psi).
202+
203+
#### Requirements
204+
205+
Pressure Stall Information requires [Linux kernel versions 4.20 or later](/docs/reference/node/kernel-version-requirements#requirements-psi).
206+
180207
## Disabling metrics
181208

182209
You can explicitly turn off metrics via command line flag `--disabled-metrics`. This may be
@@ -223,4 +250,4 @@ is encountered that is not allowed with respect to the allow-list constraints.
223250
* Read about the [Prometheus text format](https://github.com/prometheus/docs/blob/master/content/docs/instrumenting/exposition_formats.md#text-based-format)
224251
for metrics
225252
* See the list of [stable Kubernetes metrics](https://github.com/kubernetes/kubernetes/blob/master/test/instrumentation/testdata/stable-metrics-list.yaml)
226-
* Read about the [Kubernetes deprecation policy](/docs/reference/using-api/deprecation-policy/#deprecating-a-feature-or-behavior)
253+
* Read about the [Kubernetes deprecation policy](/docs/reference/using-api/deprecation-policy/#deprecating-a-feature-or-behavior)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: KubeletPSI
3+
content_type: feature_gate
4+
_build:
5+
list: never
6+
render: false
7+
8+
stages:
9+
- stage: alpha
10+
defaultValue: false
11+
fromVersion: "1.33"
12+
---
13+
Enable kubelet to surface Pressure Stall Information (PSI) metrics in the Summary API and Prometheus metrics.

content/en/docs/reference/instrumentation/node-metrics.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: >-
1010
The [kubelet](/docs/reference/command-line-tools-reference/kubelet/)
1111
gathers metric statistics at the node, volume, pod and container level,
1212
and emits this information in the
13-
[Summary API](https://github.com/kubernetes/kubernetes/blob/7d309e0104fedb57280b261e5677d919cb2a0e2d/staging/src/k8s.io/kubelet/pkg/apis/stats/v1alpha1/types.go).
13+
[Summary API](/docs/reference/config-api/kubelet-stats.v1alpha1/).
1414

1515
You can send a proxied request to the stats summary API via the
1616
Kubernetes API server.
@@ -43,6 +43,22 @@ in your cluster, and you use a container runtime that supports statistics access
4343
{{< glossary_tooltip term_id="cri" text="Container Runtime Interface">}} (CRI), then
4444
the kubelet [fetches Pod- and container-level metric data using CRI](/docs/reference/instrumentation/cri-pod-container-metrics), and not via cAdvisor.
4545

46+
## Pressure Stall Information (PSI) {#psi}
47+
48+
{{< feature-state for_k8s_version="v1.33" state="alpha" >}}
49+
50+
As an alpha feature, Kubernetes lets you configure kubelet to collect Linux kernel
51+
[Pressure Stall Information](https://docs.kernel.org/accounting/psi.html)
52+
(PSI) for CPU, memory and IO usage. The information is collected at node, pod and container level.
53+
See [Summary API](/docs/reference/config-api/kubelet-stats.v1alpha1/) for detailed schema.
54+
You must enable the `KubeletPSI` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
55+
to use this feature. The information is also exposed in
56+
[Prometheus metrics](/docs/concepts/cluster-administration/system-metrics#psi-metrics).
57+
58+
### Requirements
59+
60+
Pressure Stall Information requires [Linux kernel versions 4.20 or later](/docs/reference/node/kernel-version-requirements#requirements-psi).
61+
4662
## {{% heading "whatsnext" %}}
4763

4864
The task pages for [Troubleshooting Clusters](/docs/tasks/debug/debug-cluster/) discuss

content/en/docs/reference/node/kernel-version-requirements.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ In [Linux 5.8](https://github.com/torvalds/linux/commit/4a7e89c5ec0238017a757131
5959

6060
In runc document, Kernel older than 5.2 is not recommended due to lack of freezer.
6161

62+
## Pressure Stall Information (PSI) {#requirements-psi}
63+
64+
[Pressure Stall Information](/docs/reference/instrumentation/node-metrics#psi) is supported in Linux kernel versions 4.20 and up.
65+
6266
## Other kernel requirements {#requirements-other}
6367

6468
Some features may depend on new kernel functionalities and have specific kernel requirements:

0 commit comments

Comments
 (0)