Skip to content

Commit

Permalink
Add container labels field from ECS (#125)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Wert <[email protected]>
Co-authored-by: Joao Grassi <[email protected]>
  • Loading branch information
3 people authored Sep 26, 2023
1 parent 2ef85e6 commit 2bcee3c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<key>` 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}
Expand Down
1 change: 1 addition & 0 deletions docs/resource/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<key>` | string | Container labels, `<key>` 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"`.
Expand Down
5 changes: 5 additions & 0 deletions model/resource/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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, `<key>` being the label name, the value being the label value.
examples: [ 'container.labels.app=nginx' ]

0 comments on commit 2bcee3c

Please sign in to comment.