You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a docker container with cgroupv2 turned on I would like to see a container.id being automatically detected.
What is the actual behavior?
When I use a docker container with cgroupv2 turned on I don't get the container.id detected automatically
Additional Context
This is a known "issue", it has been fixed with the JavaScript implementation already (ContainerDetector.ts):
Detection of the container.id in ContainerResource.java currently works by reading from /proc/self/cgroup. That does not work when cgroupv2 is turned on. However, based on these two sources there's another place to read from:
In short, the container.id could be read from /proc/self/mountinfo as well. This also works for containerd and not only docker.
Eventually it would be good to have a standard for that, but unfortunately this is a long-standing non-moving OCI issue, until then a combination of both approaches seems to be reliable enough.
Issue with OpenTelemetry.Extensions.Docker
Is this a feature request or a bug?
Feature Request
What is the expected behavior?
When using a docker container with cgroupv2 turned on I would like to see a
container.id
being automatically detected.What is the actual behavior?
When I use a docker container with cgroupv2 turned on I don't get the
container.id
detected automaticallyAdditional Context
This is a known "issue", it has been fixed with the JavaScript implementation already (ContainerDetector.ts):
Detection of the
container.id
inContainerResource.java
currently works by reading from/proc/self/cgroup
. That does not work when cgroupv2 is turned on. However, based on these two sources there's another place to read from:In short, the
container.id
could be read from /proc/self/mountinfo as well. This also works forcontainerd
and not only docker.Eventually it would be good to have a standard for that, but unfortunately this is a long-standing non-moving OCI issue, until then a combination of both approaches seems to be reliable enough.
Related
We wanted to use the
container.id
as an example for resource detection at the OTel docs: open-telemetry/opentelemetry.io#1835Same ticket for Java Instrumentation: open-telemetry/opentelemetry-java-instrumentation#6694
cc @cartermp, @swetharavichandrancisco
Containerd
The Node.JS implementation also works with other container runtime implementations, namely contaienrd, probably others as well.
The text was updated successfully, but these errors were encountered: