I am trying to understand how data driven Field Config assignments work. My initial understanding was that the field config properties can be set using the data in the query result. Meaning for instance if I get the labels like ts {color="blue", displayName="Channel B"}
for my time series query, then automagically filed config properties color
and displayName
will be set accordingly.
But based on my tests as I have also mentioned here it does not seem to be the case.
That would be great if someone could elaborate on how data driven filed config assignment works and how I can use labels to assign those properites.
Tnx.
Linking to this related issue, where there is a discussion. Thanks for hopping on both, @farzadpanahi
opened 01:12AM - 14 Oct 21 UTC
closed 05:27AM - 19 Oct 21 UTC
area/transformations
<!--
Please use this template to create your bug report. By providing as much i… nfo as possible you help us understand the issue, reproduce it and resolve it for you quicker. Therefor take a couple of extra minutes to make sure you have provided all info needed.
PROTIP: record your screen and attach it as a gif to showcase the issue.
- Questions should be posted to: https://community.grafana.com
- Use query inspector to troubleshoot issues: https://bit.ly/2XNF6YS
- How to record and attach gif: https://bit.ly/2Mi8T6K
-->
**What happened**: Rows to fields is performing the rows to field change, but doesn't apply configs to affect the gauges. Furthermore, gauges do not render at all due to an error 'can't redefine nonconfigurable property'.
**What you expected to happen**: Gauges are appropriately styled + rendered
**My error case**:
I would like to set up gauges to show how full of sessions various servers are. In my setup, rows to fields is performing the rows to field change, but doesn't apply configs to affect the gauges.
Database: In my table, each server is assigned a 'switchboardID' (1, 2, 3 (or -1 for a system-wide aggregation)). Each minute, a stat is recorded for each server to a table ('concurrencyStats')
![image](https://user-images.githubusercontent.com/22365940/137229170-86b92a64-d05a-4125-a0c9-ddc95104bf32.png)
I write my query and am able to get my data OK:
![image](https://user-images.githubusercontent.com/22365940/137229522-11d4d928-e6bd-40f4-98c9-ee484bf04827.png)
Now I discard old data by using a Group By, selecting only the latest value for each switchboardID:
![image](https://user-images.githubusercontent.com/22365940/137229628-827144ba-6f8c-4282-95b1-b52383125fa8.png)
Now I have just the most recent data, with one gauge per row.
I have read that by using fields, I can configure the display of each gauge. This would allow me to have data-driven Max and Threshold configs. So I add a Rows to Fields:
![image](https://user-images.githubusercontent.com/22365940/137230037-9ebe0ec7-08dd-4f77-9f89-8b92404b7d1b.png)
This does seem to work, except I don't see any configuration values applied. IE, I would expect, [as in the docs](https://grafana.com/docs/grafana/latest/panels/transformations/rows-to-fields/), for the field name to be something like `1 (config: max=125, threshold1=100)` instead of just `1`. Maybe it is happening silently though, so I check in gauge...
On gauge view, I get an error 'Can't redefine non-configurable property 1', though table view looks like it should work (just most likely without configuration settings attached)
![image](https://user-images.githubusercontent.com/22365940/137231469-18271f85-7b62-42ba-bd15-572bd0eb41e4.png)
So, I am not sure if I have encountered a bug, or user error. Can you please advise? Thank you!
**Workaround method attempted but failed: Rows**
Sidenote, I have also tried to set up gauges by using rows instead of fields. This lets me see four gauges, but I haven not been able to customize each. Using the `${__cell_0}` syntax requires fields to be set to Numberic Fields, and then I end up with way too many gauges (one gauge per cell in the table):
![image](https://user-images.githubusercontent.com/22365940/137232984-4dc5066a-ec27-4b62-a0d8-4dcf1541bcae.png)
Setting the field to just currentlyPlaying displays the correct number of gauges, but then I can't customize them with `${__cell_0}` (doing so returns 'no data' on the gauge):
![image](https://user-images.githubusercontent.com/22365940/137233443-d18565eb-3559-4d02-aae3-17a0cbf8dfcd.png)
![image](https://user-images.githubusercontent.com/22365940/137233484-7f1a56e4-2c90-4548-8d8d-9e873b3e537a.png)
So I don't think the rows method is a good workaround for this case unless I'm missing something.
**Environment**:
- Grafana version: Grafana v8.2.1 (88622d7f09)
- Data source type & version: MySQL 5.0.0
- OS Grafana is installed on: Docker
- User OS & Browser: Firefox
- Grafana plugins:
- Others:
Thanks again, been bashing my head against this for a solid day now and thoroughly confused :)
system
Closed
October 14, 2022, 2:35am
3
This topic was automatically closed after 365 days. New replies are no longer allowed.