Creating a dataset from multiple tables to display the last value in a grid (status panel in Grafana)

The title is sub-optimal and I am pretty sure I am facing issues on both sides (Grafana and InfluxDB), but I have to start somewhere :wink:

What I am trying to achieve: creating a status panel in Grafana which shows the host name and a colour corresponding to the last value (which is an enum) for each host.

The first problem I have is that with the Flux query

from(bucket: "telegraf")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "idrac-hosts")
  |> filter(fn: (r) => r["_field"] == "psu-status")
  |> group(columns: ["agent_host"])
  |> last()

I get multiple tables with a single row:

Now I need to get this into a shape which is understood by the Grafana Status Panel, but can’t manage to do it. For some reason (I am really struggling with flux, only used the SQL-like backend before), the table plugin in Grafana shows multiple tables named “idrac-hosts” and the status panel plugin shows only one big green tile.

Can anyone toss me into the right direction how to modify the query so that I get a single table with e.g. agent_name and the _value? I assume that such a table is needed for the Status Panel plugin, but still not sure.

To have a flat table instead of a table “by series” you should have the “Format as” option (this is also the case for InfluxQL)

This alone should solve te issue

I don’t find that setting. Note that I don’t have this query builder since I am using the flux language:

I’ve never used flux yet… that’s good to know I guess

You can still try with the “Transform” section, Merge or Series to rows should give you a flat table

I ended up using the “Stat” panel, I cannot figure out how to use the Status Panel. There is literally no documentation about it.