open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.75k stars 2.19k forks source link

Get container metadata in resourcedetection processor. #33821

Open h0cheung opened 2 weeks ago

h0cheung commented 2 weeks ago

Component(s)

processor/resourcedetection, processor/resourcedetection/internal/docker

Is your feature request related to a problem? Please describe.

There is a docker detector, but it only generates host metadata.

In components such as javaagent, there are resource providers that can get the container.id field and associate it with container metadata. Is it possible to add similar functionality to this component?

Describe the solution you'd like

Add detector to get contianer.id If a container runtime API is mounted, e.g. docker.sock, associate the information directly. Otherwise we can provide another component like k8sattributes processor that runs on the host and forwards the data and adds container metadata.

Describe alternatives you've considered

No response

Additional context

No response

github-actions[bot] commented 2 weeks ago

Pinging code owners: