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

Missing some fields to support Stats API on Docker host uses cgroup2 #919

Closed
xruins opened this issue May 20, 2022 · 0 comments · Fixed by #922
Closed

Missing some fields to support Stats API on Docker host uses cgroup2 #919

xruins opened this issue May 20, 2022 · 0 comments · Fixed by #922

Comments

@xruins
Copy link
Contributor

xruins commented May 20, 2022

Docker Engine 20.10.0+ supports cgroup2 and uses it by default.

Support cgroup2 moby/moby#40174 moby/moby#40657 moby/moby#40662
cgroup2: use “systemd” cgroup driver by default when available moby/moby#40846

(cf. https://docs.docker.com/engine/release-notes/#20100 )

The output of Docker Stats API varies depending on the version of cgroup used by Docker Engine.
Especially, Stats.MemoryStats.Stats for cgroup2 host much differ from the one of cgroup.

(definition for cgroup v1)
https://github.com/moby/moby/blob/548614694305d10e25665b4a7d0f61b025d47dd1/daemon/daemon_unix.go#L1439-L1470

(definition for cgroup v2)
https://github.com/moby/moby/blob/548614694305d10e25665b4a7d0f61b025d47dd1/daemon/daemon_unix.go#L1544-L1577

Currently, Stats (https://github.com/fsouza/go-dockerclient/blob/main/container_stats.go#L26) struct has only fields for cgroup v1, so it would be better to add the fields for cgroup v2 as well.
https://github.com/fsouza/go-dockerclient/blob/main/container_stats.go#L26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants