Get total and free disk space using Prometheus

FS utilization can be calculated as

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

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.