Get total and free disk space using Prometheus Get total and free disk space using Prometheus kubernetes kubernetes

Get total and free disk space using Prometheus


According to my Grafana dashboard, the following metrics work nicely for alerting for available space,

100 - ((node_filesystem_avail_bytes{mountpoint="/",fstype!="rootfs"} * 100) / node_filesystem_size_bytes{mountpoint="/",fstype!="rootfs"})

The formula gives out the percentage of available space on the pointed disk. Make sure you include the mountpoint and fstype within the metrics.


FS utilization can be calculated as

100 - (100 * ((node_filesystem_avail_bytes{mountpoint="/",fstype!="rootfs"} )  / (node_filesystem_size_bytes{mountpoint="/",fstype!="rootfs"}) ))


According kubernetes-mixin you can use node:node_filesystem_usage, but if this metrics won't show your correct vales please ensure that device is set correctly.

I highly recommend using Prometheus Graph or Graphana Explore tab to check all available metrics.