From 2bcee3ca7904e66472bf9c91ebfa342d837759aa Mon Sep 17 00:00:00 2001 From: Chris Mark Date: Tue, 26 Sep 2023 15:51:03 +0100 Subject: [PATCH] Add container labels field from ECS (#125) Co-authored-by: Alexander Wert Co-authored-by: Joao Grassi --- CHANGELOG.md | 2 ++ docs/resource/container.md | 1 + model/resource/container.yaml | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 613d3c8278..bb6b78343a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ release. - Adds `session.id` and session.md to general docs and model ([#215](https://github.com/open-telemetry/semantic-conventions/pull/215)) +- Add `container.labels.` attributes. + ([#125](https://github.com/open-telemetry/semantic-conventions/pull/125)) - Add `cluster.name` and `node.name` attributes to Elasticsearch semantic conventions. ([#285](https://github.com/open-telemetry/semantic-conventions/pull/285)) - Fix the unit of metric.process.runtime.jvm.system.cpu.load_1m to be {run_queue_item} diff --git a/docs/resource/container.md b/docs/resource/container.md index b0017c4b36..cc9ff9fd34 100644 --- a/docs/resource/container.md +++ b/docs/resource/container.md @@ -19,6 +19,7 @@ | `container.command` | string | The command used to run the container (i.e. the command name). [3] | `otelcontribcol` | Opt-In | | `container.command_line` | string | The full command run by the container as a single string representing the full command. [2] | `otelcontribcol --config config.yaml` | Opt-In | | `container.command_args` | string[] | All the command arguments (including the command/executable itself) run by the container. [2] | `[otelcontribcol, --config, config.yaml]` | Opt-In | +| `container.labels.` | string | Container labels, `` being the label name, the value being the label value. | `container.labels.app=nginx` | Recommended | **[1]:** 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"`. diff --git a/model/resource/container.yaml b/model/resource/container.yaml index 3dbac9641b..2080b7b9c6 100644 --- a/model/resource/container.yaml +++ b/model/resource/container.yaml @@ -82,3 +82,8 @@ groups: brief: > All the command arguments (including the command/executable itself) run by the container. [2] examples: [ 'otelcontribcol, --config, config.yaml' ] + - id: labels + type: template[string] + brief: > + Container labels, `` being the label name, the value being the label value. + examples: [ 'container.labels.app=nginx' ]