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

Plan to add disk usage per container? #198

Closed
tifayuki opened this issue Aug 28, 2014 · 6 comments
Closed

Plan to add disk usage per container? #198

tifayuki opened this issue Aug 28, 2014 · 6 comments

Comments

@tifayuki
Copy link

Hi,
I wonder if there is a plan to add disk usage metrics for each container to cAdvisor. And also may include the volume size of each container?

BTW, thanks for this awesome cAdvisor project.

@rjnagal
Copy link
Contributor

rjnagal commented Aug 28, 2014

disk usage is very specific to the implementation of higher layers (docker
and non-docker use cases). We have been toying with a few ideas and hoping
to come up with something that doesn't need to run inside a user container.
That said, it will probably be much easier to build it for docker first.

We'll definitely do something for disk space soon. If you have any ideas or
a patch, please send it our way :)

On Thu, Aug 28, 2014 at 9:02 AM, tifayuki notifications@github.com wrote:

Hi,
I wonder if there is a plan to add disk usage metrics for each container
to cAdvisor. And also may include the volume size of each container?

BTW, thanks for this awesome cAdvisor project.


Reply to this email directly or view it on GitHub
#198.

@tifayuki
Copy link
Author

I was thinking that we can do docker ps -s to get the current size of each container. Then look up its image tree to get the size of its each dependent layers. Then the disk usage is the sum of those sizes. But I don't know if we should count the shared layer size or not.

@vishh vishh added this to the 0.5.1 milestone Oct 1, 2014
@vmarmol vmarmol removed this from the 0.5.1 milestone Oct 29, 2014
@vishh
Copy link
Contributor

vishh commented Jan 15, 2016

Disk usage metrics are already supported. cAdvisor could possibly expose usage of volumes if they happen to be separate filesystems. Shared volumes will be tricky to handle though.
I'm closing this issue for now.

@vishh vishh closed this as completed Jan 15, 2016
@discordianfish
Copy link
Contributor

@vishh Are they? At least they aren't available on GKE's k8s. I have container_fs_usage_bytes but without a total or free space metric this isn't useful.

@ivan046
Copy link

ivan046 commented Jun 16, 2020

Disk usage metrics are already supported. cAdvisor could possibly expose usage of volumes if they happen to be separate filesystems. Shared volumes will be tricky to handle though.
I'm closing this issue for now.

I curl the cadvisor of GKE node and get the following:

# 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="",container_name="",device="/dev/sda1",id="/",image="",name="",namespace="",pod="",pod_name=""} 9.616154624e+09 1592321393409

As you can see, container_name is empty so I can't get space used per container. why?

@DavidPerezIngeniero
Copy link

DavidPerezIngeniero commented Aug 1, 2023

I don't know how to measure the needs of ephemereal space of containers in a k8s cluster.
It would be very useful to have stats by container instead of by node.
I wonder if after eight years, any progress has been made.

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

7 participants