-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved finding docker container id on cgroup v2 enabled systems #2352
Improved finding docker container id on cgroup v2 enabled systems #2352
Conversation
👋 @tobiasstadler Thanks a lot for your contribution! It may take some time before we review a PR, so even if you don’t see activity for some time, it does not mean that we have forgotten about it. Every once in a while we go through a process of prioritization, after which we are focussing on the tasks that were planned for the upcoming milestone. The prioritization status is typically reflected through the PR labels. It could be pending triage, a candidate for a future milestone, or have a target milestone set to it. |
❕ Build Aborted
Expand to view the summary
Build stats
Steps errorsExpand to view the steps failures
|
Hi @tobiasstadler , thanks for opening this PR. As this is a cross-agent topic we will have to handle this for all agents. There is already an issue opened for that : elastic/apm#523 Do you have a reference or examples on the file format ? The tricky part here is that it makes it work only for Docker, while it allows to help run integration tests for the agent (which already helps a lot), it won't cover other types of containers. |
The file format of /proc/self/mountinfo is described in https://man7.org/linux/man-pages/man5/proc.5.html. It seems like for containerd it is (always) ${SOME_PATH}/${CONTAINER_ID}/(hostname|host|resolv.conf) (see https://github.com/containerd/containerd/blob/b93119501ff5251b1e79fcb034d78ad76793b021/pkg/cri/server/helpers_linux.go#L86). e.g. on Docker for Mac:
e.g. on Minikube with containerd:
|
In my opinion this is a step in the right direction, but definitely not the last. |
…ntainer-id-cgroup-v2
…ntainer-id-cgroup-v2
…ntainer-id-cgroup-v2
…ainer-id-cgroup-v2
…ainer-id-cgroup-v2
Superseded by #3199 , with a similar heuristic, some refactors and even a testcase in json to help testing across agents. |
What does this PR do?
Try to find the docker container id in
/proc/self/mountinfo
on group v2 enabled system. Works on Ubuntu 21.10, Fedora 35 and Docker Desktop for Mac (4.3.0)Checklist