amazon-cloudwatch-agent icon indicating copy to clipboard operation
amazon-cloudwatch-agent copied to clipboard

[k8s][containerd] container file system metrics is not supported by cadvisor for contianerd

Open pingleig opened this issue 4 years ago • 0 comments

Follow up on #188

Background

  • Upstream issue https://github.com/google/cadvisor/issues/2785
  • PR https://github.com/google/cadvisor/pull/2872 and https://github.com/google/cadvisor/pull/2936

When using containerd runtime, you will not see container filesystem metrics in structured log. Node filesystem metrics is still there, and there is no pod filesystem metrics regardless of runtime.

    "device",
    "fstype",
    "container_filesystem_available",
    "container_filesystem_capacity",
    "container_filesystem_usage",
    "container_filesystem_utilization"

Fix

That metrics is supported in both docker and crio and the rough logic is get rootfs dir for the container, base on the storage driver do some calculation, a common helper is also used to simply walk the dir and call Stat on every file (which is also how size limit is enforced by kubelet for emptydir volume).

~~We might be able to contribute to upstream~~

pingleig avatar Mar 23 '21 17:03 pingleig