Skip to content

Commit a21f24e

Browse files
authored
Add k8s.node.system_container.* metrics (#3556)
1 parent 1c18646 commit a21f24e

File tree

8 files changed

+200
-0
lines changed

8 files changed

+200
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
change_type: enhancement
2+
component: k8s
3+
note: "Add `k8s.node.system_container.*` metrics to capture node-level system daemon metrics."
4+
issues: [3531]

docs/registry/attributes/k8s.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Kubernetes resource attributes.
5353
| <a id="k8s-node-condition-type" href="#k8s-node-condition-type">`k8s.node.condition.type`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The condition type of a K8s Node. [19] | `Ready`; `DiskPressure` |
5454
| <a id="k8s-node-label" href="#k8s-node-label">`k8s.node.label.<key>`</a> | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | string | The label placed on the Node, the `<key>` being the label name, the value being the label value, even if the value is empty. [20] | `arm64`; `` |
5555
| <a id="k8s-node-name" href="#k8s-node-name">`k8s.node.name`</a> | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | string | The name of the Node. | `node-1` |
56+
| <a id="k8s-node-system-container-name" href="#k8s-node-system-container-name">`k8s.node.system_container.name`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The name of the system container running on the K8s Node. | `kubelet`; `runtime`; `pods`; `misc` |
5657
| <a id="k8s-node-uid" href="#k8s-node-uid">`k8s.node.uid`</a> | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | string | The UID of the Node. | `1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2` |
5758
| <a id="k8s-persistentvolume-annotation" href="#k8s-persistentvolume-annotation">`k8s.persistentvolume.annotation.<key>`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The annotation placed on the PersistentVolume, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty. [21] | `kubernetes.io/aws-ebs`; `` |
5859
| <a id="k8s-persistentvolume-label" href="#k8s-persistentvolume-label">`k8s.persistentvolume.label.<key>`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The label placed on the PersistentVolume, the `<key>` being the label name, the value being the label value, even if the value is empty. [22] | `ssd`; `` |

docs/registry/entities/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Currently, the following namespaces exist:
7373
| | [k8s.job](k8s.md#k8s-job) | ![Development](https://img.shields.io/badge/-development-blue) |
7474
| | [k8s.namespace](k8s.md#k8s-namespace) | ![Development](https://img.shields.io/badge/-development-blue) |
7575
| | [k8s.node](k8s.md#k8s-node) | ![Development](https://img.shields.io/badge/-development-blue) |
76+
| | [k8s.node.system_container](k8s.md#k8s-node-system-container) | ![Development](https://img.shields.io/badge/-development-blue) |
7677
| | [k8s.persistentvolume](k8s.md#k8s-persistentvolume) | ![Development](https://img.shields.io/badge/-development-blue) |
7778
| | [k8s.persistentvolumeclaim](k8s.md#k8s-persistentvolumeclaim) | ![Development](https://img.shields.io/badge/-development-blue) |
7879
| | [k8s.pod](k8s.md#k8s-pod) | ![Development](https://img.shields.io/badge/-development-blue) |

docs/registry/entities/k8s.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,20 @@ conflict.
266266
- A label `data` with empty string value SHOULD be recorded as
267267
the `k8s.node.label.data` attribute with value `""`.
268268

269+
## K8s Node System Container
270+
271+
**Status:** ![Development](https://img.shields.io/badge/-development-blue)
272+
273+
**type:** `k8s.node.system_container`
274+
275+
**Description:** A Kubernetes Node System Container.
276+
277+
**Attributes:**
278+
279+
| Role | Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
280+
| --- | --- | --- | --- | --- | --- | --- |
281+
| Identity | [`k8s.node.system_container.name`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The name of the system container running on the K8s Node. | `kubelet`; `runtime`; `pods`; `misc` |
282+
269283
## K8s Persistentvolume
270284

271285
**Status:** ![Development](https://img.shields.io/badge/-development-blue)

docs/system/k8s-metrics.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ and therefore inherit its attributes, like `k8s.pod.name` and `k8s.pod.uid`.
6161
- [Metric: `k8s.node.filesystem.available`](#metric-k8snodefilesystemavailable)
6262
- [Metric: `k8s.node.filesystem.capacity`](#metric-k8snodefilesystemcapacity)
6363
- [Metric: `k8s.node.filesystem.usage`](#metric-k8snodefilesystemusage)
64+
- [Metric: `k8s.metric.k8s.node.system_container.cpu.usage`](#metric-k8smetrick8snodesystem_containercpuusage)
65+
- [Metric: `metric.k8s.node.system_container.cpu.time`](#metric-metrick8snodesystem_containercputime)
66+
- [Metric: `metric.k8s.node.system_container.memory.working_set`](#metric-metrick8snodesystem_containermemoryworking_set)
67+
- [Metric: `metric.k8s.node.system_container.memory.usage`](#metric-metrick8snodesystem_containermemoryusage)
6468
- [Deployment metrics](#deployment-metrics)
6569
- [Metric: `k8s.deployment.pod.desired`](#metric-k8sdeploymentpoddesired)
6670
- [Metric: `k8s.deployment.pod.available`](#metric-k8sdeploymentpodavailable)
@@ -1308,6 +1312,92 @@ of the Kubelet's stats API.
13081312
<!-- END AUTOGENERATED TEXT -->
13091313
<!-- endsemconv -->
13101314

1315+
### Metric: `k8s.metric.k8s.node.system_container.cpu.usage`
1316+
1317+
This metric is [recommended][MetricRecommended].
1318+
1319+
<!-- semconv metric.k8s.node.system_container.cpu.usage -->
1320+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
1321+
<!-- see templates/registry/markdown/snippet.md.j2 -->
1322+
<!-- prettier-ignore-start -->
1323+
1324+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
1325+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
1326+
| `k8s.node.system_container.cpu.usage` | Gauge | `{cpu}` | Node's system container CPU usage, measured in cpus. [1] | ![Development](https://img.shields.io/badge/-development-blue) | [`k8s.node.system_container`](/docs/registry/entities/k8s.md#k8s-node-system-container) |
1327+
1328+
**[1]:** This metric is derived from the [CPUStats.UsageNanoCores](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L233) field of the [ContainerStats](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L157C6-L157C20) of [Node.SystemContainers](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L40) of the Kubelet's stats API.
1329+
1330+
<!-- prettier-ignore-end -->
1331+
<!-- END AUTOGENERATED TEXT -->
1332+
<!-- endsemconv -->
1333+
1334+
### Metric: `metric.k8s.node.system_container.cpu.time`
1335+
1336+
This metric is [recommended][MetricRecommended].
1337+
1338+
<!-- semconv metric.k8s.node.system_container.cpu.time -->
1339+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
1340+
<!-- see templates/registry/markdown/snippet.md.j2 -->
1341+
<!-- prettier-ignore-start -->
1342+
1343+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
1344+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
1345+
| `k8s.node.system_container.cpu.time` | Counter | `s` | Node's system container CPU time. [1] | ![Development](https://img.shields.io/badge/-development-blue) | [`k8s.node.system_container`](/docs/registry/entities/k8s.md#k8s-node-system-container) |
1346+
1347+
**[1]:** This metric is derived from the [CPUStats.UsageCoreNanoSeconds](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L236) field of the [ContainerStats](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L157C6-L157C20) of [Node.SystemContainers](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L40) of the Kubelet's stats API.
1348+
1349+
<!-- prettier-ignore-end -->
1350+
<!-- END AUTOGENERATED TEXT -->
1351+
<!-- endsemconv -->
1352+
1353+
### Metric: `metric.k8s.node.system_container.memory.working_set`
1354+
1355+
This metric is [recommended][MetricRecommended].
1356+
1357+
<!-- semconv metric.k8s.node.system_container.memory.working_set -->
1358+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
1359+
<!-- see templates/registry/markdown/snippet.md.j2 -->
1360+
<!-- prettier-ignore-start -->
1361+
1362+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
1363+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
1364+
| `k8s.node.system_container.memory.working_set` | UpDownCounter | `By` | The amount of working set memory. [1] | ![Development](https://img.shields.io/badge/-development-blue) | [`k8s.node.system_container`](/docs/registry/entities/k8s.md#k8s-node-system-container) |
1365+
1366+
**[1]:** This metric is derived from the [MemoryStats.WorkingSetBytes](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L256) field of the [ContainerStats](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L157C6-L157C20) of [Node.SystemContainers](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L40) of the Kubelet's stats API.
1367+
1368+
<!-- prettier-ignore-end -->
1369+
<!-- END AUTOGENERATED TEXT -->
1370+
<!-- endsemconv -->
1371+
1372+
**Attributes:**
1373+
1374+
| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
1375+
| --- | --- | --- | --- | --- | --- |
1376+
| [`k8s.node.system_container.name`](/docs/registry/attributes/k8s.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | The name of the system container running on the K8s Node. | `kubelet`; `runtime`; `pods`; `misc` |
1377+
1378+
<!-- prettier-ignore-end -->
1379+
<!-- END AUTOGENERATED TEXT -->
1380+
<!-- endsemconv -->
1381+
1382+
### Metric: `metric.k8s.node.system_container.memory.usage`
1383+
1384+
This metric is [recommended][MetricRecommended].
1385+
1386+
<!-- semconv metric.k8s.node.system_container.memory.usage -->
1387+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
1388+
<!-- see templates/registry/markdown/snippet.md.j2 -->
1389+
<!-- prettier-ignore-start -->
1390+
1391+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
1392+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
1393+
| `k8s.node.system_container.memory.usage` | UpDownCounter | `By` | Node's system container memory usage. [1] | ![Development](https://img.shields.io/badge/-development-blue) | [`k8s.node.system_container`](/docs/registry/entities/k8s.md#k8s-node-system-container) |
1394+
1395+
**[1]:** This metric is derived from the [MemoryStats.UsageBytes](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L252) field of the [ContainerStats](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L157C6-L157C20) of [Node.SystemContainers](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L40) of the Kubelet's stats API.
1396+
1397+
<!-- prettier-ignore-end -->
1398+
<!-- END AUTOGENERATED TEXT -->
1399+
<!-- endsemconv -->
1400+
13111401
## Deployment metrics
13121402

13131403
**Description:** Deployment level metrics captured under the namespace `k8s.deployment`.

model/k8s/entities.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ groups:
2929
role: descriptive
3030
requirement_level: opt_in
3131

32+
- id: entity.k8s.node.system_container
33+
type: entity
34+
stability: development
35+
name: k8s.node.system_container
36+
brief: >
37+
A Kubernetes Node System Container.
38+
attributes:
39+
- ref: k8s.node.system_container.name
40+
role: identifying
41+
3242
- id: entity.k8s.namespace
3343
type: entity
3444
stability: development

model/k8s/metrics.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,80 @@ groups:
560560
- k8s.node
561561
unit: "{cpu}"
562562

563+
# k8s.node.system_container.* metrics
564+
- id: metric.k8s.node.system_container.cpu.usage
565+
type: metric
566+
metric_name: k8s.node.system_container.cpu.usage
567+
annotations:
568+
code_generation:
569+
metric_value_type: double
570+
stability: development
571+
brief: "Node's system container CPU usage, measured in cpus."
572+
note: >
573+
This metric is derived from the
574+
[CPUStats.UsageNanoCores](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L233)
575+
field of the [ContainerStats](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L157C6-L157C20)
576+
of [Node.SystemContainers](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L40)
577+
of the Kubelet's stats API.
578+
instrument: gauge
579+
entity_associations:
580+
- k8s.node.system_container
581+
unit: "{cpu}"
582+
- id: metric.k8s.node.system_container.cpu.time
583+
type: metric
584+
metric_name: k8s.node.system_container.cpu.time
585+
annotations:
586+
code_generation:
587+
metric_value_type: double
588+
stability: development
589+
brief: "Node's system container CPU time."
590+
note: >
591+
This metric is derived from the
592+
[CPUStats.UsageCoreNanoSeconds](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L236)
593+
field of the [ContainerStats](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L157C6-L157C20)
594+
of [Node.SystemContainers](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L40)
595+
of the Kubelet's stats API.
596+
instrument: counter
597+
entity_associations:
598+
- k8s.node.system_container
599+
unit: "s"
600+
- id: metric.k8s.node.system_container.memory.usage
601+
type: metric
602+
metric_name: k8s.node.system_container.memory.usage
603+
annotations:
604+
code_generation:
605+
metric_value_type: int
606+
stability: development
607+
brief: "Node's system container memory usage."
608+
note: >
609+
This metric is derived from the
610+
[MemoryStats.UsageBytes](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L252)
611+
field of the [ContainerStats](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L157C6-L157C20)
612+
of [Node.SystemContainers](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L40)
613+
of the Kubelet's stats API.
614+
instrument: updowncounter
615+
entity_associations:
616+
- k8s.node.system_container
617+
unit: "By"
618+
- id: metric.k8s.node.system_container.memory.working_set
619+
type: metric
620+
metric_name: k8s.node.system_container.memory.working_set
621+
annotations:
622+
code_generation:
623+
metric_value_type: int
624+
stability: development
625+
brief: "The amount of working set memory."
626+
note: >
627+
This metric is derived from the
628+
[MemoryStats.WorkingSetBytes](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L256)
629+
field of the [ContainerStats](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L157C6-L157C20)
630+
of [Node.SystemContainers](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L40)
631+
of the Kubelet's stats API.
632+
instrument: updowncounter
633+
entity_associations:
634+
- k8s.node.system_container
635+
unit: "By"
636+
563637
# k8s.node.filesystem.* metrics
564638
- id: metric.k8s.node.filesystem.available
565639
type: metric

model/k8s/registry.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ groups:
7979
- An annotation `data` with empty string value SHOULD be recorded as
8080
the `k8s.node.annotation.data` attribute with value `""`.
8181
examples: [ '0', '' ]
82+
- id: k8s.node.system_container.name
83+
type: string
84+
stability: development
85+
brief: >
86+
The name of the system container running on the K8s Node.
87+
examples: ['kubelet', 'runtime', 'pods', 'misc']
8288
- id: k8s.namespace.name
8389
type: string
8490
stability: release_candidate

0 commit comments

Comments
 (0)