diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b62c84eb6..4a4e19d2ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ release. - Rename `system.processes.*` namespace to `system.process.*` ([#484](https://github.com/open-telemetry/semantic-conventions/pull/484)) +- Depluralize labels for pod (`k8s.pod.labels.*`) and container (`container.labels.*`) resources + ([#625](https://github.com/open-telemetry/semantic-conventions/pull/625)) ### Features diff --git a/docs/attributes-registry/container.md b/docs/attributes-registry/container.md index 7cc959620b..d9f66e67f9 100644 --- a/docs/attributes-registry/container.md +++ b/docs/attributes-registry/container.md @@ -16,7 +16,7 @@ | `container.image.name` | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | | `container.image.repo_digests` | string[] | Repo digests of the container image as provided by the container runtime. [3] | `[example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb, internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578]` | | `container.image.tags` | string[] | Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. | `[v1.27.1, 3.5.7-0]` | -| `container.labels.` | string | Container labels, `` being the label name, the value being the label value. | `container.labels.app=nginx` | +| `container.label.` | string | Container labels, `` being the label name, the value being the label value. | `container.label.app=nginx` | | `container.name` | string | Container name used by container runtime. | `opentelemetry-autoconf` | | `container.runtime` | string | The container runtime managing this container. | `docker`; `containerd`; `rkt` | diff --git a/docs/attributes-registry/k8s.md b/docs/attributes-registry/k8s.md index 56db76720d..7c85db4516 100644 --- a/docs/attributes-registry/k8s.md +++ b/docs/attributes-registry/k8s.md @@ -21,7 +21,7 @@ | `k8s.node.name` | string | The name of the Node. | `node-1` | | `k8s.node.uid` | string | The UID of the Node. | `1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2` | | `k8s.pod.annotation.` | string | The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. | `k8s.pod.annotation.kubernetes.io/enforce-mountable-secrets=true`; `k8s.pod.annotation.mycompany.io/arch=x64`; `k8s.pod.annotation.data=` | -| `k8s.pod.labels.` | string | The labels placed on the Pod, the `` being the label name, the value being the label value. | `k8s.pod.labels.app=my-app`; `k8s.pod.labels.mycompany.io/arch=x64`; `k8s.pod.labels.data=` | +| `k8s.pod.label.` | string | The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. | `k8s.pod.label.app=my-app`; `k8s.pod.label.mycompany.io/arch=x64`; `k8s.pod.label.data=` | | `k8s.pod.name` | string | The name of the Pod. | `opentelemetry-pod-autoconf` | | `k8s.pod.uid` | string | The UID of the Pod. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | | `k8s.replicaset.name` | string | The name of the ReplicaSet. | `opentelemetry` | diff --git a/docs/resource/container.md b/docs/resource/container.md index 1abdd5c277..7606ce6178 100644 --- a/docs/resource/container.md +++ b/docs/resource/container.md @@ -17,7 +17,7 @@ | [`container.image.name`](../attributes-registry/container.md) | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | Recommended | | [`container.image.repo_digests`](../attributes-registry/container.md) | string[] | Repo digests of the container image as provided by the container runtime. [3] | `[example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb, internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578]` | Recommended | | [`container.image.tags`](../attributes-registry/container.md) | string[] | Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. | `[v1.27.1, 3.5.7-0]` | Recommended | -| [`container.labels.`](../attributes-registry/container.md) | string | Container labels, `` being the label name, the value being the label value. | `container.labels.app=nginx` | Recommended | +| [`container.label.`](../attributes-registry/container.md) | string | Container labels, `` being the label name, the value being the label value. | `container.label.app=nginx` | Recommended | | [`container.name`](../attributes-registry/container.md) | string | Container name used by container runtime. | `opentelemetry-autoconf` | Recommended | | [`container.runtime`](../attributes-registry/container.md) | string | The container runtime managing this container. | `docker`; `containerd`; `rkt` | Recommended | | [`oci.manifest.digest`](../attributes-registry/oci.md) | string | The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. [4] | `sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4` | Recommended | diff --git a/docs/resource/k8s.md b/docs/resource/k8s.md index d8f048fe5a..1dd9a9fdee 100644 --- a/docs/resource/k8s.md +++ b/docs/resource/k8s.md @@ -92,7 +92,7 @@ containers on your cluster. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | [`k8s.pod.annotation.`](../attributes-registry/k8s.md) | string | The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. | `k8s.pod.annotation.kubernetes.io/enforce-mountable-secrets=true`; `k8s.pod.annotation.mycompany.io/arch=x64`; `k8s.pod.annotation.data=` | Opt-In | -| [`k8s.pod.labels.`](../attributes-registry/k8s.md) | string | The labels placed on the Pod, the `` being the label name, the value being the label value. | `k8s.pod.labels.app=my-app`; `k8s.pod.labels.mycompany.io/arch=x64`; `k8s.pod.labels.data=` | Recommended | +| [`k8s.pod.label.`](../attributes-registry/k8s.md) | string | The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. | `k8s.pod.label.app=my-app`; `k8s.pod.label.mycompany.io/arch=x64`; `k8s.pod.label.data=` | Recommended | | [`k8s.pod.name`](../attributes-registry/k8s.md) | string | The name of the Pod. | `opentelemetry-pod-autoconf` | Recommended | | [`k8s.pod.uid`](../attributes-registry/k8s.md) | string | The UID of the Pod. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | Recommended | diff --git a/model/registry/container.yaml b/model/registry/container.yaml index 0755d078af..4b11e772fd 100644 --- a/model/registry/container.yaml +++ b/model/registry/container.yaml @@ -79,8 +79,8 @@ groups: brief: > All the command arguments (including the command/executable itself) run by the container. [2] examples: [ 'otelcontribcol, --config, config.yaml' ] - - id: labels + - id: label type: template[string] brief: > Container labels, `` being the label name, the value being the label value. - examples: [ 'container.labels.app=nginx' ] + examples: [ 'container.label.app=nginx' ] diff --git a/model/registry/k8s.yaml b/model/registry/k8s.yaml index e9cecc107e..efda36e993 100644 --- a/model/registry/k8s.yaml +++ b/model/registry/k8s.yaml @@ -64,11 +64,11 @@ groups: brief: > The name of the Pod. examples: ['opentelemetry-pod-autoconf'] - - id: pod.labels + - id: pod.label type: template[string] brief: > - The labels placed on the Pod, the `` being the label name, the value being the label value. - examples: ['k8s.pod.labels.app=my-app', 'k8s.pod.labels.mycompany.io/arch=x64', 'k8s.pod.labels.data='] + The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. + examples: ['k8s.pod.label.app=my-app', 'k8s.pod.label.mycompany.io/arch=x64', 'k8s.pod.label.data='] - id: pod.annotation type: template[string] brief: > diff --git a/model/resource/container.yaml b/model/resource/container.yaml index 97923e440e..c0034ca7ca 100644 --- a/model/resource/container.yaml +++ b/model/resource/container.yaml @@ -18,5 +18,5 @@ groups: requirement_level: opt_in - ref: container.command_args requirement_level: opt_in - - ref: container.labels + - ref: container.label - ref: oci.manifest.digest diff --git a/model/resource/k8s.yaml b/model/resource/k8s.yaml index 6020d7904f..e61bf0cad1 100644 --- a/model/resource/k8s.yaml +++ b/model/resource/k8s.yaml @@ -33,7 +33,7 @@ groups: attributes: - ref: k8s.pod.uid - ref: k8s.pod.name - - ref: k8s.pod.labels + - ref: k8s.pod.label - ref: k8s.pod.annotation requirement_level: opt_in diff --git a/schema-next.yaml b/schema-next.yaml index aca72805d2..58de42a543 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -13,6 +13,11 @@ versions: - rename_metrics: system.processes.count: system.process.count system.processes.created: system.process.created + # https://github.com/open-telemetry/semantic-conventions/pull/625 + - rename_attributes: + attribute_map: + container.labels: container.label + k8s.pod.labels: k8s.pod.label 1.24.0: metrics: changes: