Hi Grafana Community,
We recently upgraded our Grafana instance from v10.4.19 to v12.4.3 and encountered a critical issue with variable passing in dashboards that use a custom datasource plugin (which is now deprecated and stopped updates since Jan 1st).
Problem Summary
-
In dashboards like “Service Report”, variables such as
DeviceType,DeviceName,Active,Columnsetc. are no longer passed correctly to the backend datasource service. -
As a result, sub-device data (e.g., reachability and availability) cannot be retrieved.
Root Cause (observed)
By comparing the /query request payloads between v10 and v12, we found that the scopedVars structure has changed abnormally:
Grafana v10.4.19 (working as expected):
json
"scopedVars": {
"DeviceType": {...},
"DeviceName": {...},
"Active": {...}
}
Grafana v12.4.3 (broken):
json
"scopedVars": {
"undefined": {...}
}
-
All variable keys are replaced with the literal string
"undefined". -
Multiple variables are reduced to only the last one.
-
The
targets[0].datafield remains unchanged and still contains the correct variable values.
Additional Context
-
The custom datasource plugin acts as a bridge between Grafana and our backend service.
-
The plugin is no longer maintained (last update: Jan 1, 2023).
-
The issue only appears after upgrading to Grafana v12; v10 works fine.
-
We are aware that this might be a known Grafana v12 bug (still present in v13 according to some sources).
Our Question to the Community
-
Is this a confirmed Grafana core bug related to
scopedVarshandling in v12+? -
Are there any known workarounds (e.g., plugin-side patches, configuration flags, or frontend hooks) that can restore correct variable passing without downgrading Grafana?
-
If we were to develop a new custom datasource plugin to replace the deprecated one, what is the recommended way to retrieve dashboard variables reliably in v12+ (e.g., reading from
targets[0].datainstead ofscopedVars)?
Environment
-
Grafana versions: v10.4.19 (working), v12.4.3 (broken), also tested v13 (still broken)
-
Datasource plugin: custom JSON/HTTP plugin (EOL since Jan 1, 2023)
-
Backend: custom service that receives transformed queries from the plugin
