Skip to content

Commit 332b19b

Browse files
committed
add condition reason and fix modeling
Signed-off-by: ChrsMark <[email protected]>
1 parent 34f1e08 commit 332b19b

File tree

4 files changed

+82
-45
lines changed

4 files changed

+82
-45
lines changed

docs/registry/attributes/k8s.md

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Kubernetes resource attributes.
1414
|---|---|---|---|---|
1515
| <a id="k8s-cluster-name" href="#k8s-cluster-name">`k8s.cluster.name`</a> | string | The name of the cluster. | `opentelemetry-cluster` | ![Development](https://img.shields.io/badge/-development-blue) |
1616
| <a id="k8s-cluster-uid" href="#k8s-cluster-uid">`k8s.cluster.uid`</a> | string | A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. [1] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | ![Development](https://img.shields.io/badge/-development-blue) |
17-
| <a id="k8s-condition-state" href="#k8s-condition-state">`k8s.condition.state`</a> | string | The state of a condition | `true`; `false`; `unknown` | ![Development](https://img.shields.io/badge/-development-blue) |
1817
| <a id="k8s-container-name" href="#k8s-container-name">`k8s.container.name`</a> | string | The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). | `redis` | ![Development](https://img.shields.io/badge/-development-blue) |
1918
| <a id="k8s-container-restart-count" href="#k8s-container-restart-count">`k8s.container.restart_count`</a> | int | Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. | | ![Development](https://img.shields.io/badge/-development-blue) |
2019
| <a id="k8s-container-status-last-terminated-reason" href="#k8s-container-status-last-terminated-reason">`k8s.container.status.last_terminated_reason`</a> | string | Last terminated reason of the Container. | `Evicted`; `Error` | ![Development](https://img.shields.io/badge/-development-blue) |
@@ -43,24 +42,26 @@ Kubernetes resource attributes.
4342
| <a id="k8s-namespace-name" href="#k8s-namespace-name">`k8s.namespace.name`</a> | string | The name of the namespace that the pod is running in. | `default` | ![Development](https://img.shields.io/badge/-development-blue) |
4443
| <a id="k8s-namespace-phase" href="#k8s-namespace-phase">`k8s.namespace.phase`</a> | string | The phase of the K8s namespace. [12] | `active`; `terminating` | ![Development](https://img.shields.io/badge/-development-blue) |
4544
| <a id="k8s-node-annotation" href="#k8s-node-annotation">`k8s.node.annotation.<key>`</a> | string | The annotation placed on the Node, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty. [13] | `0`; `` | ![Development](https://img.shields.io/badge/-development-blue) |
46-
| <a id="k8s-node-condition" href="#k8s-node-condition">`k8s.node.condition`</a> | string | The condition of a K8s Node. [14] | `Ready`; `DiskPressure` | ![Development](https://img.shields.io/badge/-development-blue) |
47-
| <a id="k8s-node-label" href="#k8s-node-label">`k8s.node.label.<key>`</a> | 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. [15] | `arm64`; `` | ![Development](https://img.shields.io/badge/-development-blue) |
45+
| <a id="k8s-node-condition-reason" href="#k8s-node-condition-reason">`k8s.node.condition.reason`</a> | string | The reason for the condition's last transition [14] | `KubeletHasSufficientMemory`; `KubeletHasNoDiskPressure`; `KubeletHasSufficientPID` | ![Development](https://img.shields.io/badge/-development-blue) |
46+
| <a id="k8s-node-condition-status" href="#k8s-node-condition-status">`k8s.node.condition.status`</a> | string | The status of the condition, one of True, False, Unknown. [15] | `true`; `false`; `unknown` | ![Development](https://img.shields.io/badge/-development-blue) |
47+
| <a id="k8s-node-condition-type" href="#k8s-node-condition-type">`k8s.node.condition.type`</a> | string | The condition type of a K8s Node. [16] | `Ready`; `DiskPressure` | ![Development](https://img.shields.io/badge/-development-blue) |
48+
| <a id="k8s-node-label" href="#k8s-node-label">`k8s.node.label.<key>`</a> | 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. [17] | `arm64`; `` | ![Development](https://img.shields.io/badge/-development-blue) |
4849
| <a id="k8s-node-name" href="#k8s-node-name">`k8s.node.name`</a> | string | The name of the Node. | `node-1` | ![Development](https://img.shields.io/badge/-development-blue) |
4950
| <a id="k8s-node-uid" href="#k8s-node-uid">`k8s.node.uid`</a> | string | The UID of the Node. | `1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2` | ![Development](https://img.shields.io/badge/-development-blue) |
50-
| <a id="k8s-pod-annotation" href="#k8s-pod-annotation">`k8s.pod.annotation.<key>`</a> | string | The annotation placed on the Pod, the `<key>` being the annotation name, the value being the annotation value. [16] | `true`; `x64`; `` | ![Development](https://img.shields.io/badge/-development-blue) |
51-
| <a id="k8s-pod-label" href="#k8s-pod-label">`k8s.pod.label.<key>`</a> | string | The label placed on the Pod, the `<key>` being the label name, the value being the label value. [17] | `my-app`; `x64`; `` | ![Development](https://img.shields.io/badge/-development-blue) |
51+
| <a id="k8s-pod-annotation" href="#k8s-pod-annotation">`k8s.pod.annotation.<key>`</a> | string | The annotation placed on the Pod, the `<key>` being the annotation name, the value being the annotation value. [18] | `true`; `x64`; `` | ![Development](https://img.shields.io/badge/-development-blue) |
52+
| <a id="k8s-pod-label" href="#k8s-pod-label">`k8s.pod.label.<key>`</a> | string | The label placed on the Pod, the `<key>` being the label name, the value being the label value. [19] | `my-app`; `x64`; `` | ![Development](https://img.shields.io/badge/-development-blue) |
5253
| <a id="k8s-pod-name" href="#k8s-pod-name">`k8s.pod.name`</a> | string | The name of the Pod. | `opentelemetry-pod-autoconf` | ![Development](https://img.shields.io/badge/-development-blue) |
5354
| <a id="k8s-pod-uid" href="#k8s-pod-uid">`k8s.pod.uid`</a> | string | The UID of the Pod. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Development](https://img.shields.io/badge/-development-blue) |
54-
| <a id="k8s-replicaset-annotation" href="#k8s-replicaset-annotation">`k8s.replicaset.annotation.<key>`</a> | string | The annotation key-value pairs placed on the ReplicaSet. [18] | `k8s.replicaset.annotation.replicas=0`; `k8s.replicaset.annotation.data=` | ![Development](https://img.shields.io/badge/-development-blue) |
55-
| <a id="k8s-replicaset-label" href="#k8s-replicaset-label">`k8s.replicaset.label.<key>`</a> | string | The label key-value pairs placed on the ReplicaSet. [19] | `k8s.replicaset.label.app=guestbook`; `k8s.replicaset.label.injected=` | ![Development](https://img.shields.io/badge/-development-blue) |
55+
| <a id="k8s-replicaset-annotation" href="#k8s-replicaset-annotation">`k8s.replicaset.annotation.<key>`</a> | string | The annotation key-value pairs placed on the ReplicaSet. [20] | `k8s.replicaset.annotation.replicas=0`; `k8s.replicaset.annotation.data=` | ![Development](https://img.shields.io/badge/-development-blue) |
56+
| <a id="k8s-replicaset-label" href="#k8s-replicaset-label">`k8s.replicaset.label.<key>`</a> | string | The label key-value pairs placed on the ReplicaSet. [21] | `k8s.replicaset.label.app=guestbook`; `k8s.replicaset.label.injected=` | ![Development](https://img.shields.io/badge/-development-blue) |
5657
| <a id="k8s-replicaset-name" href="#k8s-replicaset-name">`k8s.replicaset.name`</a> | string | The name of the ReplicaSet. | `opentelemetry` | ![Development](https://img.shields.io/badge/-development-blue) |
5758
| <a id="k8s-replicaset-uid" href="#k8s-replicaset-uid">`k8s.replicaset.uid`</a> | string | The UID of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Development](https://img.shields.io/badge/-development-blue) |
5859
| <a id="k8s-replicationcontroller-name" href="#k8s-replicationcontroller-name">`k8s.replicationcontroller.name`</a> | string | The name of the replication controller. | `opentelemetry` | ![Development](https://img.shields.io/badge/-development-blue) |
5960
| <a id="k8s-replicationcontroller-uid" href="#k8s-replicationcontroller-uid">`k8s.replicationcontroller.uid`</a> | string | The UID of the replication controller. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Development](https://img.shields.io/badge/-development-blue) |
6061
| <a id="k8s-resourcequota-name" href="#k8s-resourcequota-name">`k8s.resourcequota.name`</a> | string | The name of the resource quota. | `opentelemetry` | ![Development](https://img.shields.io/badge/-development-blue) |
6162
| <a id="k8s-resourcequota-uid" href="#k8s-resourcequota-uid">`k8s.resourcequota.uid`</a> | string | The UID of the resource quota. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Development](https://img.shields.io/badge/-development-blue) |
62-
| <a id="k8s-statefulset-annotation" href="#k8s-statefulset-annotation">`k8s.statefulset.annotation.<key>`</a> | string | The annotation key-value pairs placed on the StatefulSet. [20] | `k8s.statefulset.annotation.replicas=1`; `k8s.statefulset.annotation.data=` | ![Development](https://img.shields.io/badge/-development-blue) |
63-
| <a id="k8s-statefulset-label" href="#k8s-statefulset-label">`k8s.statefulset.label.<key>`</a> | string | The label key-value pairs placed on the StatefulSet. [21] | `k8s.statefulset.label.app=guestbook`; `k8s.statefulset.label.injected=` | ![Development](https://img.shields.io/badge/-development-blue) |
63+
| <a id="k8s-statefulset-annotation" href="#k8s-statefulset-annotation">`k8s.statefulset.annotation.<key>`</a> | string | The annotation key-value pairs placed on the StatefulSet. [22] | `k8s.statefulset.annotation.replicas=1`; `k8s.statefulset.annotation.data=` | ![Development](https://img.shields.io/badge/-development-blue) |
64+
| <a id="k8s-statefulset-label" href="#k8s-statefulset-label">`k8s.statefulset.label.<key>`</a> | string | The label key-value pairs placed on the StatefulSet. [23] | `k8s.statefulset.label.app=guestbook`; `k8s.statefulset.label.injected=` | ![Development](https://img.shields.io/badge/-development-blue) |
6465
| <a id="k8s-statefulset-name" href="#k8s-statefulset-name">`k8s.statefulset.name`</a> | string | The name of the StatefulSet. | `opentelemetry` | ![Development](https://img.shields.io/badge/-development-blue) |
6566
| <a id="k8s-statefulset-uid" href="#k8s-statefulset-uid">`k8s.statefulset.uid`</a> | string | The UID of the StatefulSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Development](https://img.shields.io/badge/-development-blue) |
6667
| <a id="k8s-volume-name" href="#k8s-volume-name">`k8s.volume.name`</a> | string | The name of the K8s volume. | `volume0` | ![Development](https://img.shields.io/badge/-development-blue) |
@@ -129,17 +130,26 @@ conflict.
129130
- An annotation `data` with empty string value SHOULD be recorded as
130131
the `k8s.node.annotation.data` attribute with value `""`.
131132

132-
**[14] `k8s.node.condition`:** K8s Node conditions as described
133+
**[14] `k8s.node.condition.reason`:** This attribute aligns with the `reason` field of the
134+
[NodeCondition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#nodecondition-v1-core)
135+
136+
**[15] `k8s.node.condition.status`:** This attribute aligns with the `status` field of the
137+
[NodeCondition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#nodecondition-v1-core)
138+
139+
**[16] `k8s.node.condition.type`:** K8s Node conditions as described
133140
by [K8s documentation](https://v1-32.docs.kubernetes.io/docs/reference/node/node-status/#condition).
134141

135-
**[15] `k8s.node.label.<key>`:** Examples:
142+
This attribute aligns with the `type` field of the
143+
[NodeCondition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#nodecondition-v1-core)
144+
145+
**[17] `k8s.node.label.<key>`:** Examples:
136146

137147
- A label `kubernetes.io/arch` with value `arm64` SHOULD be recorded
138148
as the `k8s.node.label.kubernetes.io/arch` attribute with value `"arm64"`.
139149
- A label `data` with empty string value SHOULD be recorded as
140150
the `k8s.node.label.data` attribute with value `""`.
141151

142-
**[16] `k8s.pod.annotation.<key>`:** Examples:
152+
**[18] `k8s.pod.annotation.<key>`:** Examples:
143153

144154
- An annotation `kubernetes.io/enforce-mountable-secrets` with value `true` SHOULD be recorded as
145155
the `k8s.pod.annotation.kubernetes.io/enforce-mountable-secrets` attribute with value `"true"`.
@@ -148,7 +158,7 @@ by [K8s documentation](https://v1-32.docs.kubernetes.io/docs/reference/node/node
148158
- An annotation `data` with empty string value SHOULD be recorded as
149159
the `k8s.pod.annotation.data` attribute with value `""`.
150160

151-
**[17] `k8s.pod.label.<key>`:** Examples:
161+
**[19] `k8s.pod.label.<key>`:** Examples:
152162

153163
- A label `app` with value `my-app` SHOULD be recorded as
154164
the `k8s.pod.label.app` attribute with value `"my-app"`.
@@ -157,23 +167,13 @@ by [K8s documentation](https://v1-32.docs.kubernetes.io/docs/reference/node/node
157167
- A label `data` with empty string value SHOULD be recorded as
158168
the `k8s.pod.label.data` attribute with value `""`.
159169

160-
**[18] `k8s.replicaset.annotation.<key>`:** The `<key>` being the annotation name, the value being the annotation value, even if the value is empty.
170+
**[20] `k8s.replicaset.annotation.<key>`:** The `<key>` being the annotation name, the value being the annotation value, even if the value is empty.
161171

162-
**[19] `k8s.replicaset.label.<key>`:** The `<key>` being the label name, the value being the label value, even if the value is empty.
172+
**[21] `k8s.replicaset.label.<key>`:** The `<key>` being the label name, the value being the label value, even if the value is empty.
163173

164-
**[20] `k8s.statefulset.annotation.<key>`:** The `<key>` being the annotation name, the value being the annotation value, even if the value is empty.
174+
**[22] `k8s.statefulset.annotation.<key>`:** The `<key>` being the annotation name, the value being the annotation value, even if the value is empty.
165175

166-
**[21] `k8s.statefulset.label.<key>`:** The `<key>` being the label name, the value being the label value, even if the value is empty.
167-
168-
---
169-
170-
`k8s.condition.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
171-
172-
| Value | Description | Stability |
173-
|---|---|---|
174-
| `false` | condition_false | ![Development](https://img.shields.io/badge/-development-blue) |
175-
| `true` | condition_true | ![Development](https://img.shields.io/badge/-development-blue) |
176-
| `unknown` | condition_unknown | ![Development](https://img.shields.io/badge/-development-blue) |
176+
**[23] `k8s.statefulset.label.<key>`:** The `<key>` being the label name, the value being the label value, even if the value is empty.
177177

178178
---
179179

@@ -212,7 +212,17 @@ by [K8s documentation](https://v1-32.docs.kubernetes.io/docs/reference/node/node
212212

213213
---
214214

215-
`k8s.node.condition` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
215+
`k8s.node.condition.status` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
216+
217+
| Value | Description | Stability |
218+
|---|---|---|
219+
| `false` | condition_false | ![Development](https://img.shields.io/badge/-development-blue) |
220+
| `true` | condition_true | ![Development](https://img.shields.io/badge/-development-blue) |
221+
| `unknown` | condition_unknown | ![Development](https://img.shields.io/badge/-development-blue) |
222+
223+
---
224+
225+
`k8s.node.condition.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
216226

217227
| Value | Description | Stability |
218228
|---|---|---|

0 commit comments

Comments
 (0)