Hi, I’m trying desperately to properly configure a panel using PostgreSQL as a data source. This panel has two queries from the same table with different conditions. Data is visualized via a time series.
The example output data looks like this:
date | value | meter |
---|---|---|
2023-11-12 10:11:12 | 0.444 | Meter 1 |
2023-11-11 10:11:12 | 0.333 | Meter 1 |
2023-11-10 10:11:12 | 0.222 | Meter 1 |
2023-11-09 10:11:12 | 0.111 | Meter 1 |
and similar for the second query:
date | value | meter |
---|---|---|
2023-11-12 10:11:12 | 3 | Meter 2 |
2023-11-11 10:11:12 | 2.5 | Meter 2 |
2023-11-10 10:11:12 | 2.0 | Meter 2 |
2023-11-09 10:11:12 | 1.5 | Meter 2 |
The problem: the chart shows the two graphs, but both have value
as the label. Unfortunately, the PostgreSQL provides no option to set a label directly on the query.
-
What Grafana version and what operating system are you using?
- Grafana in Docker, v10.1.1 (0cfa76b22d)
-
What are you trying to achieve?
- I would like to set the label of a query from a field, in this case it would be the value of
meter
.
- I would like to set the label of a query from a field, in this case it would be the value of
-
How are you trying to achieve it?
- I have no idea. I tried so many things I found on the internet, but none worked. Neither using data links in the
Display Name
config, nor using transforms to change the outputs. Closest I could get is with the Config from field transform, but it removes all but one query results.
- I have no idea. I tried so many things I found on the internet, but none worked. Neither using data links in the
Related but without working answer: