Skip to content

Resource Detection for container properties (e.g.container.id) #1372

@svrnm

Description

@svrnm

Is your feature request related to a problem?

Detecting the id of the container that holds the service instrumented with otel allows end-users to correlate container issues with service issues.

Describe the solution you'd like
I see some of that implemented in the AWS Extension, but I was wondering if there's a way to have this standalone.

Describe alternatives you've considered
Injecting the container id via an environment variable is always possible.

Additional context
Semantic conventions for container resource: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/container.md

A similar implementation exists for Java, JS, .NET & Go already. The .JS is the most advanced since it also works with containers when cgroup v2 is used:

https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/detectors/node/opentelemetry-resource-detector-container/src/detectors/ContainerDetector.ts

We are also currently trying at opentelemetry.io to have per-language pages on resources and used the container detection as an example besides using the environment variable:

open-telemetry/opentelemetry.io#1773
and
https://opentelemetry.io/docs/instrumentation/js/resources/

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions