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

Support disk usage stats for containerd #5882

Closed
vsxen opened this issue Aug 16, 2021 · 3 comments
Closed

Support disk usage stats for containerd #5882

vsxen opened this issue Aug 16, 2021 · 3 comments
Labels
kind/external Issue in external component being tracked by containerd kind/question

Comments

@vsxen
Copy link

vsxen commented Aug 16, 2021

https://github.com/google/cadvisor/blob/master/container/containerd/handler.go#L171-L181

google/cadvisor#2666

container_fs_usage_bytes metrics don't report container fs usage.

root@ubuntu-focal:/home/vagrant# kubectl get --raw="/api/v1/nodes/ubuntu-focal/proxy/metrics/cadvisor" |grep container_fs_usage_bytes
# HELP container_fs_usage_bytes Number of bytes that are consumed by the container on this filesystem.
# TYPE container_fs_usage_bytes gauge
container_fs_usage_bytes{container="",device="/dev/sda1",id="/",image="",name="",namespace="",pod=""} 1.012353024e+10 1629159063329
container_fs_usage_bytes{container="",device="/dev/shm",id="/",image="",name="",namespace="",pod=""} 0 1629159063329
container_fs_usage_bytes{container="",device="/run",id="/",image="",name="",namespace="",pod=""} 5.046272e+06 1629159063329
container_fs_usage_bytes{container="",device="/run/containerd/io.containerd.grpc.v1.cri/sandboxes/1d046c4a94b4c9e44c08a2e89d577903dbaa6bddd0c9ee13ada83004345b6479/shm",id="/",image="",name="",namespace="",pod=""} 0 1629159063329
container_fs_usage_bytes{container="",device="/run/containerd/io.containerd.grpc.v1.cri/sandboxes/46f9e546407baf5bdd5acc8f2d360296c645803a51d9c8ce6d5cd42318b66594/shm",id="/",image="",name="",namespace="",pod=""} 0 1629159063329
container_fs_usage_bytes{container="",device="/run/containerd/io.containerd.grpc.v1.cri/sandboxes/835cd29badcb083d666de98d66363f123792f8edcc5b3f78032f322eeeef83cc/shm",id="/",image="",name="",namespace="",pod=""} 0 1629159063329
container_fs_usage_bytes{container="",device="/run/containerd/io.containerd.grpc.v1.cri/sandboxes/c09286ad7a86892d2880f776920dde0891d8dff7e8549b5c85b06f71573c3e30/shm",id="/",image="",name="",namespace="",pod=""} 0 1629159063329
container_fs_usage_bytes{container="",device="/run/lock",id="/",image="",name="",namespace="",pod=""} 0 1629159063329
container_fs_usage_bytes{container="",device="/run/snapd/ns",id="/",image="",name="",namespace="",pod=""} 5.046272e+06 1629159063329
container_fs_usage_bytes{container="",device="/run/user/1000",id="/",image="",name="",namespace="",pod=""} 0 1629159063329
container_fs_usage_bytes{container="",device="/sys/fs/cgroup",id="/",image="",name="",namespace="",pod=""} 0 1629159063329
container_fs_usage_bytes{container="",device="overlay_0-54",id="/",image="",name="",namespace="",pod=""} 1.012353024e+10 1629159063329
container_fs_usage_bytes{container="",device="overlay_0-55",id="/",image="",name="",namespace="",pod=""} 1.012353024e+10 1629159063329
container_fs_usage_bytes{container="",device="overlay_0-56",id="/",image="",name="",namespace="",pod=""} 1.012353024e+10 1629159063329
container_fs_usage_bytes{container="",device="overlay_0-57",id="/",image="",name="",namespace="",pod=""} 1.012353024e+10 1629159063329
container_fs_usage_bytes{container="",device="overlay_0-90",id="/",image="",name="",namespace="",pod=""} 1.012353024e+10 1629159063329
container_fs_usage_bytes{container="",device="overlay_0-91",id="/",image="",name="",namespace="",pod=""} 1.012353024e+10 1629159063329
container_fs_usage_bytes{container="",device="overlay_0-92",id="/",image="",name="",namespace="",pod=""} 1.012353024e+10 1629159063329
container_fs_usage_bytes{container="",device="overlay_0-93",id="/",image="",name="",namespace="",pod=""} 1.012353024e+10 1629159063329
root@ubuntu-focal:/home/vagrant# kubectl get no -owide
NAME           STATUS   ROLES                  AGE   VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION     CONTAINER-RUNTIME
ubuntu-focal   Ready    control-plane,master   17h   v1.21.1   10.0.2.15     <none>        Ubuntu 20.04.2 LTS   5.4.0-80-generic   containerd://1.5.2
@vsxen vsxen added the kind/bug label Aug 16, 2021
@AkihiroSuda AkihiroSuda added kind/duplicate Duplicated issues kind/question and removed kind/bug kind/duplicate Duplicated issues labels Aug 16, 2021
@AkihiroSuda AkihiroSuda reopened this Aug 16, 2021
@AkihiroSuda
Copy link
Member

We already have usage stat API

rpc Usage(UsageRequest) returns (UsageResponse);

@vsxen
Copy link
Author

vsxen commented Aug 18, 2021

can you open a PR to fix this issue?

@fuweid fuweid added the kind/external Issue in external component being tracked by containerd label Aug 18, 2021
@fuweid
Copy link
Member

fuweid commented Aug 18, 2021

@vsxen It is related to cadvisor and there is pr google/cadvisor#2872. Thanks for reporting. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/external Issue in external component being tracked by containerd kind/question
Projects
None yet
Development

No branches or pull requests

3 participants