Hi all!
My goal is to change the color of a stat value, based on the result of another query (on the same row in this case). Influx data looks like this:
| timestamp | float | error_state |
|---|---|---|
| 164566 | 22.1 | 1 |
The float value should be colored based on the value of error_state (traffic lights):
| error_state | color |
|---|---|
| 1 | green(ok) |
| 2 | orange(warn) |
| 3 | red(error) |
The two queries look like this:
float:
SELECT mean("float") FROM "autogen"."nodes_hist" WHERE ("nodeId" = 'c57ab2fdfce1b7a1cf4e32d3638fc159') AND $timeFilter GROUP BY time($__interval) fill(none) ORDER BY time DESC LIMIT 10000
error_state:
SELECT last("error_state") FROM "autogen"."nodes_hist" WHERE ("nodeId" = 'c57ab2fdfce1b7a1cf4e32d3638fc159') AND $timeFilter GROUP BY time($__interval) fill(none) ORDER BY time DESC LIMIT 10000
I went through the documentation of transforms and to me it sounds like Config from query results should do what I want. So I implemented the following transform:
I tried various Use as configurations (value mappings, …) but none of them worked for the coloring. It seems I’m not in general on the wrong path, since when I use decimals or unit it works like expected (see images). Still I do not get the coloring based on external value working.
Any help would be appreciated!
Regards,
Oliver







