PanelQueryRunner: add datasource name to queries (#16712)

This commit is contained in:
Ryan McKinley
2019-04-22 19:14:42 -07:00
committed by GitHub
parent db584b3d28
commit ff870e08b2

View File

@@ -133,6 +133,14 @@ export class PanelQueryRunner {
? (datasource as DataSourceApi)
: 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 norm = kbn.calculateInterval(timeRange, widthPixels, lowerIntervalLimit);