[SOLVED] How to show the max() of multiple entries in a time series?


I have grafana with influxDB monitoring my unRAID NAS which has:
a) 3 Array disks
b) 2 Cache disks
c) 3 Pool disks
d) 1 Backup disk

I’m trying to setup a panel to show disk “load” for each group (a, b, c and d) where load means the maximum io_time of any disk in that group, e.g. if 1 of the 3 disks in my “array” group is maxed out that should translate to 100% load for the array group.

In this version (which groups by disk serial) io_time is reported properly. You’ll see I have a query for each disk group but the graph and legend show one entry per disk instead of one per disk group (what I’m trying to get.)

In this version where I drop the “group by” and use max() to try to select the highest io_time within the disk group it shows the correct number of entries but reports erroneous results (note the missing ~95% load from 4:00-7:30)

Is there any way to accomplish what I want? I’m very new to grafana so sorry if I’m missing something obvious.

EDIT: Solved, see below


I solved this by switching to a single query for all disks (preserving the “group by serial”) then using an add field from calculation transform for to select Max for each disk group. Here it is for the “array” disk group:

Hmm, I tried to post the screenshots but apparently new users are limited to 2 embedded images so I can’t.