-
Notifications
You must be signed in to change notification settings - Fork 23
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
Fix behavior of cgroups path discovery #136
Fix behavior of cgroups path discovery #136
Conversation
Decided to just fix #139 while I'm at it, so I can at least run the tests. |
Okay cleaning up the unit tests is harder than I thought |
Alright, the fix is still kind of broken for cases where we're trying to monitor a process on the host system that doesn't belong to a root cgroup. I think we need to use the host paths to find the actual cgroup on the host system, and then construct the bath inside |
So, tests are finally passing. One thing I'd like to add is some kind of manual bypass/setting for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok.
Can you add some examples to the PR description about what is now supported and any details on which versions of docker this applies to.
What does this PR do?
Fixes #132
and fixes #139
This sanitizes the "relative" namespace mounts that we get when we monitor the host system from within newer versions of docker.
This also adds much more complex logic for setting the v2 rootpath we use for fetching metrics from v2 cgroups paths.
This also aggressively cleans up the unit tests in
cgroup
because they were a messWith this change, cgroups metric collection works properly on docker configs where where the container is using a private namespace. This value is configurable from docker 1.41+
Checklist
CHANGELOG.md
How to test this PR
go test ./tests
from the repo rootelastic-agent-system-metrics
, runsystem/process
metrics.