How do I graph disk space? (or: How does the Y axis work?)

Hi all,

New to grafana - I have got collectd, postgresql/timescaledb and grafana to talk to one another, now I want to show some data, starting with disk space.

What I have are used, free and reserved absolute values for each disk. What I need to do is:

  • Set the Y axis range from zero to the size of the disk (used+free).
  • Graph the used amount.

I am stuck specifically on how to set the range on the Y axis. There is an undocumented free form text box called “Min” and “Max” under “Field” in the graph, but there is no clue as to what these values need to be set to. In my case “Min” is zero, that’s easy, but “Max” is the size of the disk, and I can’t seem to find any intuitive way to set this from a query.

Does anyone know?

Regards,
Graham

Hi,

You have several ways to solve this but not exactly as you want as you can either set the “Max” to a constant value or leave it dynamic based on your displayed series. The two ways I think of are:

  • Set “Max” to 100 and do the calculation in your query to always show a percentage of used disk space.
  • Show your two (or three) series on the graph and stack them (option available under “Display” > “Stacking and null value”).

I hope it helps!

Set “Max” to 100 and do the calculation in your query to always show a percentage of used disk space.

Alas the percentage gives you the correct range, but in the process you lose the absolute value. It looks like grafana was designed to graph single values, rather than fractions (numerator and denominator).

Show your two (or three) series on the graph and stack them

To confirm - what is the correct way to structure a SQL query for stacking a graph? Do you select multiple values in the query (as opposed to just “value”), or do you add multiple queries (A, B, etc)?

I see stacking is not available in a bar gauge.