Skip to content

Commit 15f0d88

Browse files
More informative container runtime #2342 (#2407)
Signed-off-by: James Thompson <[email protected]> Co-authored-by: Jina Jain <[email protected]>
1 parent c21e560 commit 15f0d88

File tree

9 files changed

+148
-38
lines changed

9 files changed

+148
-38
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Use this changelog template to create an entry for release notes.
2+
#
3+
# If your change doesn't affect end users you should instead start
4+
# your pull request title with [chore] or use the "Skip Changelog" label.
5+
6+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
7+
change_type: breaking
8+
9+
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
10+
component: container
11+
12+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
13+
note: The container runtime can now also have the version and description provided
14+
15+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
16+
# The values here must be integers.
17+
issues: [2342]
18+
19+
# (Optional) One or more lines of additional information to render under the primary note.
20+
# These lines will be padded with 2 spaces and then inserted directly into the document.
21+
# Use pipe (|) for multiline entries.
22+
subtext:

docs/non-normative/k8s-migration.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ and one for disabling the old schema called `semconv.k8s.disableLegacy`. Then:
6363
- [K8s Node condition metrics](#k8s-node-condition-metrics)
6464
- [K8s Filesystem metrics](#k8s-filesystem-metrics)
6565
- [K8s Pod Volume metrics](#k8s-pod-volume-metrics)
66+
- [Container Runtime](#container-runtime)
6667

6768
<!-- tocstop -->
6869

@@ -417,4 +418,19 @@ The changes in these metrics are the following:
417418
| `k8s.volume.inodes.free` | `k8s.pod.volume.inode.free` |
418419
| `k8s.volume.inodes.used` | `k8s.pod.volume.inode.used` |
419420

421+
<!-- prettier-ignore-end -->
422+
423+
### Container Runtime
424+
425+
The container runtime has become more descriptive with changes introduced to semantic conventions
426+
within v1.Y.Z <!--[v1.29.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.29.0/docs/system/k8s-metrics.md)-->.
427+
428+
The changes in their attributes are the following:
429+
420430
<!-- prettier-ignore-start -->
431+
432+
| Old Attribute ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New Attribute |
433+
|------------------------------------------------------------------------------------|--------------------------|
434+
| `container.runtime` | `container.runtime.name` |
435+
436+
<!-- prettier-ignore-end -->

docs/registry/attributes/container.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ A container instance.
2424
| <a id="container-image-tags" href="#container-image-tags">`container.image.tags`</a> | 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"]` | ![Development](https://img.shields.io/badge/-development-blue) |
2525
| <a id="container-label" href="#container-label">`container.label.<key>`</a> | string | Container labels, `<key>` being the label name, the value being the label value. [6] | `nginx` | ![Development](https://img.shields.io/badge/-development-blue) |
2626
| <a id="container-name" href="#container-name">`container.name`</a> | string | Container name used by container runtime. | `opentelemetry-autoconf` | ![Development](https://img.shields.io/badge/-development-blue) |
27-
| <a id="container-runtime" href="#container-runtime">`container.runtime`</a> | string | The container runtime managing this container. | `docker`; `containerd`; `rkt` | ![Development](https://img.shields.io/badge/-development-blue) |
27+
| <a id="container-runtime-description" href="#container-runtime-description">`container.runtime.description`</a> | string | A description about the runtime which could include, for example details about the CRI/API version being used or other customisations. | `docker://19.3.1 - CRI: 1.22.0` | ![Development](https://img.shields.io/badge/-development-blue) |
28+
| <a id="container-runtime-name" href="#container-runtime-name">`container.runtime.name`</a> | string | The container runtime managing this container. | `docker`; `containerd`; `rkt` | ![Development](https://img.shields.io/badge/-development-blue) |
29+
| <a id="container-runtime-version" href="#container-runtime-version">`container.runtime.version`</a> | string | The version of the runtime of this process, as returned by the runtime without modification. | `1.0.0` | ![Development](https://img.shields.io/badge/-development-blue) |
2830

2931
**[1] `container.command`:** If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage.
3032

@@ -48,6 +50,7 @@ Describes deprecated container attributes.
4850
|---|---|---|---|---|
4951
| <a id="container-cpu-state" href="#container-cpu-state">`container.cpu.state`</a> | string | Deprecated, use `cpu.mode` instead. | `user`; `kernel` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `cpu.mode`. |
5052
| <a id="container-labels" href="#container-labels">`container.labels.<key>`</a> | string | Deprecated, use `container.label` instead. | `nginx` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `container.label`. |
53+
| <a id="container-runtime" href="#container-runtime">`container.runtime`</a> | string | The container runtime managing this container. | `docker`; `containerd`; `rkt` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `container.runtime.name`. |
5154

5255
---
5356

docs/registry/entities/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ Currently, the following namespaces exist:
4343
| | [cloudfoundry.system](cloudfoundry.md#cloudfoundry-system) | ![Development](https://img.shields.io/badge/-development-blue) |
4444
| Container | | |
4545
| | [container](container.md#container) | ![Development](https://img.shields.io/badge/-development-blue) |
46+
| | [container.image](container.md#container-image) | ![Development](https://img.shields.io/badge/-development-blue) |
47+
| | [container.runtime](container.md#container-runtime) | ![Development](https://img.shields.io/badge/-development-blue) |
4648
| Deployment | | |
4749
| | [deployment](deployment.md#deployment) | ![Development](https://img.shields.io/badge/-development-blue) |
4850
| Device | | |

docs/registry/entities/container.md

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,66 @@
2121
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
2222
|---|---|---|---|---|---|
2323
| [`container.id`](/docs/registry/attributes/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
24-
| [`container.image.id`](/docs/registry/attributes/container.md) | string | Runtime specific image identifier. Usually a hash algorithm followed by a UUID. [1] | `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
25-
| [`container.image.name`](/docs/registry/attributes/container.md) | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
26-
| [`container.image.repo_digests`](/docs/registry/attributes/container.md) | string[] | Repo digests of the container image as provided by the container runtime. [2] | `["example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578"]` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
27-
| [`container.image.tags`](/docs/registry/attributes/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` | ![Development](https://img.shields.io/badge/-development-blue) |
28-
| [`container.label.<key>`](/docs/registry/attributes/container.md) | string | Container labels, `<key>` being the label name, the value being the label value. [3] | `nginx` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
24+
| [`container.label.<key>`](/docs/registry/attributes/container.md) | string | Container labels, `<key>` being the label name, the value being the label value. [1] | `nginx` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
2925
| [`container.name`](/docs/registry/attributes/container.md) | string | Container name used by container runtime. | `opentelemetry-autoconf` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
30-
| [`container.runtime`](/docs/registry/attributes/container.md) | string | The container runtime managing this container. | `docker`; `containerd`; `rkt` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
31-
| [`oci.manifest.digest`](/docs/registry/attributes/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` | ![Development](https://img.shields.io/badge/-development-blue) |
32-
| [`container.command`](/docs/registry/attributes/container.md) | string | The command used to run the container (i.e. the command name). [5] | `otelcontribcol` | `Opt-In` | ![Development](https://img.shields.io/badge/-development-blue) |
26+
| [`oci.manifest.digest`](/docs/registry/attributes/oci.md) | string | The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. [2] | `sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
27+
| [`container.command`](/docs/registry/attributes/container.md) | string | The command used to run the container (i.e. the command name). [3] | `otelcontribcol` | `Opt-In` | ![Development](https://img.shields.io/badge/-development-blue) |
3328
| [`container.command_args`](/docs/registry/attributes/container.md) | string[] | All the command arguments (including the command/executable itself) run by the container. | `["otelcontribcol", "--config", "config.yaml"]` | `Opt-In` | ![Development](https://img.shields.io/badge/-development-blue) |
3429
| [`container.command_line`](/docs/registry/attributes/container.md) | string | The full command run by the container as a single string representing the full command. | `otelcontribcol --config config.yaml` | `Opt-In` | ![Development](https://img.shields.io/badge/-development-blue) |
3530

36-
**[1] `container.image.id`:** Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint.
31+
**[1] `container.label.<key>`:** For example, a docker container label `app` with value `nginx` SHOULD be recorded as the `container.label.app` attribute with value `"nginx"`.
32+
33+
**[2] `oci.manifest.digest`:** Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests).
34+
An example can be found in [Example Image Manifest](https://github.com/opencontainers/image-spec/blob/main/manifest.md#example-image-manifest).
35+
36+
**[3] `container.command`:** If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage.
37+
38+
## Container Image
39+
40+
**Status:** ![Development](https://img.shields.io/badge/-development-blue)
41+
42+
**type:** `container.image`
43+
44+
**Description:** The image used for the container.
45+
46+
**Other Attributes:**
47+
48+
> :warning: This entity definition contains attributes without a role.
49+
> Stable Entities MUST NOT have attributes without a defined role.
50+
51+
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
52+
|---|---|---|---|---|---|
53+
| [`container.image.id`](/docs/registry/attributes/container.md) | string | Runtime specific image identifier. Usually a hash algorithm followed by a UUID. [4] | `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
54+
| [`container.image.name`](/docs/registry/attributes/container.md) | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
55+
| [`container.image.repo_digests`](/docs/registry/attributes/container.md) | string[] | Repo digests of the container image as provided by the container runtime. [5] | `["example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578"]` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
56+
| [`container.image.tags`](/docs/registry/attributes/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` | ![Development](https://img.shields.io/badge/-development-blue) |
57+
58+
**[4] `container.image.id`:** Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint.
3759
K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`.
3860
The ID is assigned by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes.
3961

40-
**[2] `container.image.repo_digests`:** [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field.
62+
**[5] `container.image.repo_digests`:** [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field.
4163

42-
**[3] `container.label.<key>`:** For example, a docker container label `app` with value `nginx` SHOULD be recorded as the `container.label.app` attribute with value `"nginx"`.
64+
## Container Runtime
4365

44-
**[4] `oci.manifest.digest`:** Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests).
45-
An example can be found in [Example Image Manifest](https://github.com/opencontainers/image-spec/blob/main/manifest.md#example-image-manifest).
66+
**Status:** ![Development](https://img.shields.io/badge/-development-blue)
67+
68+
**type:** `container.runtime`
4669

47-
**[5] `container.command`:** If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage.
70+
**Description:** The runtime being used to run the container
71+
72+
**Identifying Attributes:**
73+
74+
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
75+
|---|---|---|---|---|---|
76+
| [`container.runtime.name`](/docs/registry/attributes/container.md) | string | The container runtime managing this container. | `docker`; `containerd`; `rkt` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
77+
| [`container.runtime.version`](/docs/registry/attributes/container.md) | string | The version of the runtime of this process, as returned by the runtime without modification. | `1.0.0` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
78+
79+
**Descriptive Attributes:**
80+
81+
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
82+
|---|---|---|---|---|---|
83+
| [`container.runtime.description`](/docs/registry/attributes/container.md) | string | A description about the runtime which could include, for example details about the CRI/API version being used or other customisations. | `docker://19.3.1 - CRI: 1.22.0` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
4884

4985

5086
<!-- markdownlint-restore -->

0 commit comments

Comments
 (0)