Skip to content

Commit d0edaba

Browse files
authored
Merge pull request #26 from Dalvany/fix-datasource-not-found
Fix change in options.targets.datasource
2 parents 8e68e34 + 39a5dea commit d0edaba

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/datasource.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ export class CompareQueriesDatasource {
3030
// Called once per panel (graph)
3131
query(options) {
3232
var _this = this;
33-
var sets = _.groupBy(options.targets, 'datasource');
33+
var sets = _.groupBy(options.targets, function(ds) {
34+
// Trying to maintain compatibility with grafana lower then 8.3.x
35+
if (ds.datasource.uid === undefined) {
36+
return ds.datasource;
37+
}
38+
return ds.datasource.uid;
39+
});
3440
var querys = _.groupBy(options.targets, 'refId');
3541
var promises: any[] = [];
3642
_.forEach(sets, function(targets, dsName) {

0 commit comments

Comments
 (0)