Disk usage as percentage of used disk

Hi! Maybe someone here can explain this as I am new to Grafana. I would like to see the used disk in percentage when using the piechart. I am using graphite as datasource and Nagios (Check MK) sends it data to Graphite.

No matter what I try with percentage of and so on I still do not get the right pie chart. See the image here for details. The chart should be 50/50 in this case.

You want to graph used and free, not used and size. The percentages are correct, they’re just being calculated as a percentage of the graph total so you want the graph total to be the total size of the disk (not the size plus the used amount).

1 Like

Hi, have you solved that problem? I have the same challange here:
https://community.grafana.com/t/subtract-two-values-with-graphite-possible/1839/1

i also do not have the free value right now. I think as workaround a math function (subtract “used” from “total”) could help here.

Hi, while researching to achieve the same thing, I stumbled upon this post and want to share my solution:

  1. Go into the Transform data tab, press “+ Add transformation” and choose “Add field from calculation”. Choose the Mode “binary operation”. Then create the operation “total data size” minus “used data size”. You can give your new field an alias name like “free storage”:

  2. Now you have three fields, but want to hide the field with the total size. This post helped me find a solution for that. Scroll the right panel down to the bottom and click “+ Add field override”. Select “Fields with name”. Choose your “total size”-field and press “+ Add override property”. Then select “Series > Hide in area”. To completely hide the data point, click on all three fields (tooltip, Viz and Legend). Now the “total size”-field should be hidden.

Hope this helps :slight_smile: