Skip to content

Commit

Permalink
Depluralize labels for pod and container resources (#625)
Browse files Browse the repository at this point in the history
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Co-authored-by: Joao Grassi <joao.grassi@dynatrace.com>
  • Loading branch information
ChrsMark and joaopgrassi authored Jan 9, 2024
1 parent 75f9d42 commit 73b488a
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/attributes-registry/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<tag>` section of the full name for example from `registry.example.com/my-org/my-image:<tag>`. | `[v1.27.1, 3.5.7-0]` |
| `container.labels.<key>` | string | Container labels, `<key>` being the label name, the value being the label value. | `container.labels.app=nginx` |
| `container.label.<key>` | string | Container labels, `<key>` 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` |

Expand Down
2 changes: 1 addition & 1 deletion docs/attributes-registry/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<key>` | string | The annotation key-value pairs placed on the Pod, the `<key>` 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.<key>` | string | The labels placed on the Pod, the `<key>` 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.<key>` | string | The label key-value pairs placed on the Pod, the `<key>` 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` |
Expand Down
2 changes: 1 addition & 1 deletion docs/resource/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<tag>` section of the full name for example from `registry.example.com/my-org/my-image:<tag>`. | `[v1.27.1, 3.5.7-0]` | Recommended |
| [`container.labels.<key>`](../attributes-registry/container.md) | string | Container labels, `<key>` being the label name, the value being the label value. | `container.labels.app=nginx` | Recommended |
| [`container.label.<key>`](../attributes-registry/container.md) | string | Container labels, `<key>` 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 |
Expand Down
2 changes: 1 addition & 1 deletion docs/resource/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ containers on your cluster.
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| [`k8s.pod.annotation.<key>`](../attributes-registry/k8s.md) | string | The annotation key-value pairs placed on the Pod, the `<key>` 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.<key>`](../attributes-registry/k8s.md) | string | The labels placed on the Pod, the `<key>` 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.<key>`](../attributes-registry/k8s.md) | string | The label key-value pairs placed on the Pod, the `<key>` 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 |
<!-- endsemconv -->
Expand Down
4 changes: 2 additions & 2 deletions model/registry/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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, `<key>` being the label name, the value being the label value.
examples: [ 'container.labels.app=nginx' ]
examples: [ 'container.label.app=nginx' ]
6 changes: 3 additions & 3 deletions model/registry/k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<key>` 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 `<key>` 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: >
Expand Down
2 changes: 1 addition & 1 deletion model/resource/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion model/resource/k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions schema-next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 73b488a

Please sign in to comment.