snowflake-grafana-datasource
snowflake-grafana-datasource copied to clipboard
Why does the query create a new series name for each combination of labels?
Using this query in timeseries mode
SELECT $__timeGroup(TIME,'2m') AS TIME, AVG(WIFI_RSSI) AS avg_wifi_rssi, name
FROM table WHERE $__timeFilter(TIME)
AND WIFI_RSSI <> -1
GROUP BY TIME, name
ORDER BY TIME
I get results which are avg_wifi_rssi_<name>_<name> whereas a native timeseries would have avg_wifi_rssi{name=<value>}
Looking at the code here seems relevant, but I don't understand why this is being done?
If the question is about the duplicate label in the column name, yes I agree, that should be fixed.
As for the rest — yes, the general behavior is expected. Since you’re grouping by both TIME and name, Grafana needs to create a distinct series per name to show their individual RSSI evolution over time. That’s exactly how time series mode is meant to work.
A native time series format (like from Prometheus or InfluxDB) returns series with labels (e.g., avg_wifi_rssi{name="device1"}), which Grafana handles more gracefully. But with SQL-based sources, Grafana builds those labels manually from the columns.
Great, thanks for the quick response.