DataDog / datadog-agent

Main repository for Datadog Agent
https://docs.datadoghq.com/
Apache License 2.0
2.83k stars 1.19k forks source link

Support cgroup2 for docker integration #7865

Open com6056 opened 3 years ago

com6056 commented 3 years ago

Describe what happened: Docker integration fails to detect cgroup mount for cgroup2:

2021-04-13 07:22:54 UTC | PROCESS | WARN | (pkg/util/containers/providers/cgroup/cgroup_detect.go:137 in parseCgroupMountPoints) | No mountPoints were detected, current cgroup root is: /host/sys/fs/cgroup/

It is mounted though as cgroup2 filesystem type:

root@d6d9293d2d3c:/# mount | grep cgroup
cgroup2 on /sys/fs/cgroup type cgroup2 (ro,nosuid,nodev,noexec,relatime,seclabel)
cgroup2 on /host/sys/fs/cgroup type cgroup2 (ro,nosuid,nodev,noexec,relatime,seclabel)

Suspect it is because of this line only checking for cgroup filesystem type: https://github.com/DataDog/datadog-agent/blob/e081bed84866686eeab56a98da5ff9b4b9f03ded/pkg/util/containers/providers/cgroup/cgroup_detect.go#L121

Describe what you expected: Expect it to work with cgroup2 🙌

Steps to reproduce the issue: Setup the docker agent with a system using cgroup2.

Additional environment details (Operating System, Cloud provider, etc): Fedora 33, Podman 3.0.1

fede843 commented 2 years ago

Same happens in Debian 11.

fede843 commented 2 years ago

is there a workaround yet?

sarahhodne commented 2 years ago

Looks like #9121 started some of the work on this, but it's yet to be fully integrated, if I'm reading the code and PR discussion correctly.

fede843 commented 2 years ago

Hello, yes, I've been told in internal ticket, that 7.33 should have improvements on this. Let's wait for it

JaneJeon commented 2 years ago

Well, 7.33 is here and it still doesn't support this.

ademar59 commented 2 years ago

in 7.33 docker stats metrics are available though container. (not docker. anymore)

Engineering has introduced some additional metrics in version 7.33.0, however, these will be included under the new container check rather than the docker check. 

This is meant to have cgroup v1 and v2 support, as well as provide a container runtime agnostic view to the metrics. 
The idea is to have standard container.* metrics rather than: docker, cri-o, containerd specific metrics.
JaneJeon commented 2 years ago

Hmm, I suppose it's no surprise that it doesn't work with the docker dashboard (which is a shame), but it doesn't work with the "containers" view as well (https://app.datadoghq.com/containers).

jharris-tc commented 2 years ago

+1 here, having the same problem. Does not show up in the containers view or the docker view.

j0sh3rs commented 2 years ago

Same, this issue is still ongoing. Ubuntu 21.10 on a raspberry pi 4b, Docker + Container metrics are not present in Datadog.