Equivalent of "Alias by" with Postgres? (to customize legend text)

as you can see the default legend looks like this:
Screenshot from 2021-11-08 16-17-50
But I would like it to look like this:
Screenshot from 2021-11-08 16-17-43

For InfluxDB for instance, one can use the “Alias by” field to specify which key should be used to name the legend.

But when using Postgres as a datasource, how to specify the “hostname” key?

In my case, this is also one of the column names after the SELECT sql statement.

Any help/guidance/suggestions would be greatly appreciated!


  • grafana v8.2

what does your raw, unformatted data look like?