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

disk space usage metrics #3684

Closed
anarcat opened this Issue Jan 15, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@anarcat
Copy link

anarcat commented Jan 15, 2018

I have recently made some tests with prometheus, and one of my key concerns is disk space usage. Because there is no downsampling (planned? prometheus/tsdb#56, #1381), I worry that altering the retention period to a much larger range (say one year) will take an abusive amount of disk space (and hurt performance but that's another question).

I have kept an eye on disk space by running du -sch /var/lib/prometheus by hand, and I know others are running prometheus on its own partition which makes monitoring easier, but i would like to avoid complicating the deployment...

Shouldn't there be a metric exposed by prometheus about the disk space it uses? it probably knows how many chunks it has - how hard would it be to expand that to the actual disk space in use?

(edit: i found out about process_resident_memory_bytes which seems to be giving a good metric for memory usage).

Thanks!

@anarcat anarcat changed the title (disk) space usage metrics disk space usage metrics Jan 15, 2018

@anarcat

This comment has been minimized.

Copy link
Author

anarcat commented Jan 16, 2018

I have just noticed this excellent tutorial which partly covers the requirement here, although it is not shipped out of the box.

The only way I could find to do this (and it's in tsdb) is with a crude patch that walks the filesystem, which is not much faster than the above implementation. The patch is in anarcat/tsdb@2ba6cb8 but i'm worried it will hurt performance.

We could assume the disk cache will be primed and that listing directories in the chunks storage will be fast enough, but I'm not familiar enough with the new storage engine to assert that confidently.

anarcat added a commit to anarcat/node_exporter that referenced this issue Jan 16, 2018

add sample directory size exporter
This is a possible workaround for the lack of metrics in the new
storage backend, as documented in:

prometheus/prometheus#3684

Partly inspired by this post as well:

https://www.robustperception.io/monitoring-directory-sizes-with-the-textfile-collector/
@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jan 16, 2018

It should be fast, but I think it'd be better to be tracking this internally.

@anarcat

This comment has been minimized.

Copy link
Author

anarcat commented Jan 16, 2018

yeah well, i couldn't figure out how to do this - the Chunk objects seem to be variable length so they're not useful, and i suspect only some of those are kept in memory anyways...

anarcat added a commit to anarcat/node_exporter that referenced this issue Jan 16, 2018

add sample directory size exporter
This is a possible workaround for the lack of metrics in the new
storage backend, as documented in:

prometheus/prometheus#3684

Partly inspired by this post as well:

https://www.robustperception.io/monitoring-directory-sizes-with-the-textfile-collector/

anarcat added a commit to anarcat/node_exporter that referenced this issue Jan 16, 2018

add sample directory size exporter
This is a possible workaround for the lack of metrics in the new
storage backend, as documented in:

prometheus/prometheus#3684

Partly inspired by this post as well:

https://www.robustperception.io/monitoring-directory-sizes-with-the-textfile-collector/

SuperQ added a commit to prometheus/node_exporter that referenced this issue Feb 21, 2018

add sample directory size exporter (#789)
* add sample directory size exporter

This is a possible workaround for the lack of metrics in the new
storage backend, as documented in:

prometheus/prometheus#3684

Partly inspired by this post as well:

https://www.robustperception.io/monitoring-directory-sizes-with-the-textfile-collector/

* properly escape backslashes and double-quotes
@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Sep 6, 2018

Relates to prometheus/tsdb#343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.