Skip to content
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

Docker memory metrics don't consider cgroups version of running container #40060

Closed
fearful-symmetry opened this issue Jun 28, 2024 · 3 comments · Fixed by #41449
Closed

Docker memory metrics don't consider cgroups version of running container #40060

fearful-symmetry opened this issue Jun 28, 2024 · 3 comments · Fixed by #41449
Assignees
Labels
bug Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Comments

@fearful-symmetry
Copy link
Contributor

Right now, the docker/memory metrics just do this to fetch RSS memory:

totalRSS := myRawStat.Stats.MemoryStats.Stats["total_rss"]

The problem is, the Stats object reports different metrics depending on the cgroups version: https://github.com/moby/moby/blob/master/daemon/stats_unix.go. That total_rss field isn't on V2.

The code doesn't consider this, and the docs only mention it briefly: https://docs.docker.com/engine/api/v1.45/#tag/Container/operation/ContainerStats

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 28, 2024
@ycombinator ycombinator added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Jun 28, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 28, 2024
@fearful-symmetry fearful-symmetry self-assigned this Jul 1, 2024
@andrew-moldovan
Copy link

@fearful-symmetry @pierrehilbert any updates on this one? It would really help us out with https://elasticco.atlassian.net/browse/CP-2371

@fearful-symmetry
Copy link
Contributor Author

huh, I thought this was fixed months ago, I can take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants