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

container_fs_usage_bytes metrics miss pod/container label #3495

Open
tripitakav opened this issue Mar 11, 2024 · 4 comments
Open

container_fs_usage_bytes metrics miss pod/container label #3495

tripitakav opened this issue Mar 11, 2024 · 4 comments

Comments

@tripitakav
Copy link

kubectl version: v1.24.15-eks
contained: 1.6.19

@chengjoey
Copy link

func (h *containerdContainerHandler) GetSpec() (info.ContainerSpec, error) {
// TODO: Since we dont collect disk usage stats for containerd, we set hasFilesystem
// to false. Revisit when we support disk usage stats for containerd
hasFilesystem := false
hasNet := h.includedMetrics.Has(container.NetworkUsageMetrics)
spec, err := common.GetSpec(h.cgroupPaths, h.machineInfoFactory, hasNet, hasFilesystem)
spec.Labels = h.labels
spec.Envs = h.envs
spec.Image = h.image
return spec, err
}

containerd not support fs disk usage yet

@chengjoey
Copy link

when use containerd cri, we could get mountinfo from proc/self/mountinfo like this:

2826 28 0:478 / /run/containerd/io.containerd.runtime.v2.task/k8s.io/02f14690a20e38c89d9f1c251b2b043c542e49d9aa62baa3408fb3e51d369819/rootfs rw,relatime shared:811 - overlay overlay rw,lowerdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/66230/fs:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/66153/fs:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/66152/fs:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/66151/fs:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/59780/fs,upperdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/66239/fs,workdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/66239/work,index=off

Therefore, when we query the disk usage of contianerd, we can use this directory/run/containerd/io.containerd.runtime.v2.task/k8s.io/02f14690a20e38c89d9f1c251b2b043c542e49d9aa62baa3408fb3e51d369819/rootfs

@chengjoey
Copy link

get disk usage by containerd rootfs:
image

@chengjoey
Copy link

#3502

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

No branches or pull requests

2 participants