Noch verfügbarer Speicher anzeigen mit Grafana Dashboard und Prometheus

Hello, I would like to display the percent free memory of the node in Grafana Dashboard with Prometheus database and node exporter as tools. Unfortunately I can’t get it to work when I calculate 100+ disk-using / (disk-available + disk-using).
Here is the code I use.

100 * sum(storj_total_diskspace{type="used", instance=~"$node.*"}) by (instance)
/
(
  sum(storj_total_diskspace{type="available", instance=~"$node.*"}) by (instance)
  +
  sum(storj_total_diskspace{type="used", instance=~"$node.*"}) by (instance)
). 

Unfortunately it doesn’t give me the correct percentages because Disk-used seems to be based on monthly data consumption and not on what’s on the HDD like in the Node Dashboard. Could someone help me a little?

You will probably also have to divide the usage by the number of hours since the start of the month until the end of the selected period, since the usage is most likely measured in GB*hours.

1 Like