<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/attribute_namespace.md.j2 -->

# Container

- [Container Attributes](#container-attributes)
- [Deprecated Container Attributes](#deprecated-container-attributes)

## Container Attributes

A container instance.

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="container-command" href="#container-command">`container.command`</a> | string | The command used to run the container (i.e. the command name). [1] | `otelcontribcol` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="container-command-args" href="#container-command-args">`container.command_args`</a> | string[] | All the command arguments (including the command/executable itself) run by the container. | `["otelcontribcol", "--config", "config.yaml"]` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="container-command-line" href="#container-command-line">`container.command_line`</a> | string | The full command run by the container as a single string representing the full command. | `otelcontribcol --config config.yaml` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="container-csi-plugin-name" href="#container-csi-plugin-name">`container.csi.plugin.name`</a> | string | The name of the CSI ([Container Storage Interface](https://github.com/container-storage-interface/spec)) plugin used by the volume. [2] | `pd.csi.storage.gke.io` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="container-csi-volume-id" href="#container-csi-volume-id">`container.csi.volume.id`</a> | string | The unique volume ID returned by the CSI ([Container Storage Interface](https://github.com/container-storage-interface/spec)) plugin. [3] | `projects/my-gcp-project/zones/my-gcp-zone/disks/my-gcp-disk` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="container-id" href="#container-id">`container.id`</a> | 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` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="container-image-id" href="#container-image-id">`container.image.id`</a> | string | Runtime specific image identifier. Usually a hash algorithm followed by a UUID. [4] | `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="container-image-name" href="#container-image-name">`container.image.name`</a> | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="container-image-repo-digests" href="#container-image-repo-digests">`container.image.repo_digests`</a> | 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"]` | ![Development](https://img.shields.io/badge/-development-blue) |
| <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) |
| <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) |
| <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) |
| <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) |

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

**[2] `container.csi.plugin.name`:** This can sometimes be referred to as a "driver" in CSI implementations. This should represent the `name` field of the GetPluginInfo RPC.

**[3] `container.csi.volume.id`:** This can sometimes be referred to as a "volume handle" in CSI implementations. This should represent the `Volume.volume_id` field in CSI spec.

**[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.
K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`.
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.

**[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.

**[6] `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"`.

## Deprecated Container Attributes

Describes deprecated container attributes.

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <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` |
| <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`. |

---

`container.cpu.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.

| Value  | Description | Stability |
|---|---|---|
| `kernel` | When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows). | ![Development](https://img.shields.io/badge/-development-blue) |
| `system` | When CPU is used by the system (host OS) | ![Development](https://img.shields.io/badge/-development-blue) |
| `user` | When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows). | ![Development](https://img.shields.io/badge/-development-blue) |
