mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PanelQueryRunner: add datasource name to queries (#16712)
This commit is contained in:
@@ -133,6 +133,14 @@ export class PanelQueryRunner {
|
|||||||
? (datasource as DataSourceApi)
|
? (datasource as DataSourceApi)
|
||||||
: await getDatasourceSrv().get(datasource as string, request.scopedVars);
|
: await getDatasourceSrv().get(datasource as string, request.scopedVars);
|
||||||
|
|
||||||
|
// Attach the datasource name to each query
|
||||||
|
request.targets = request.targets.map(query => {
|
||||||
|
if (!query.datasource) {
|
||||||
|
query.datasource = ds.name;
|
||||||
|
}
|
||||||
|
return query;
|
||||||
|
});
|
||||||
|
|
||||||
const lowerIntervalLimit = minInterval ? templateSrv.replace(minInterval, request.scopedVars) : ds.interval;
|
const lowerIntervalLimit = minInterval ? templateSrv.replace(minInterval, request.scopedVars) : ds.interval;
|
||||||
const norm = kbn.calculateInterval(timeRange, widthPixels, lowerIntervalLimit);
|
const norm = kbn.calculateInterval(timeRange, widthPixels, lowerIntervalLimit);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user