beats icon indicating copy to clipboard operation
beats copied to clipboard

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

Open fearful-symmetry opened this issue 1 year ago • 1 comments

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

fearful-symmetry avatar Jun 28 '24 16:06 fearful-symmetry

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

elasticmachine avatar Jun 28 '24 18:06 elasticmachine

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

andrew-moldovan avatar Oct 23 '24 15:10 andrew-moldovan

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

fearful-symmetry avatar Oct 24 '24 14:10 fearful-symmetry