Query: send datasourceId along with datasource ref (#41830)

This commit is contained in:
Ryan McKinley
2021-11-17 21:00:50 +01:00
committed by GitHub
parent d49230d291
commit e5811ad106
2 changed files with 5 additions and 0 deletions
@@ -68,6 +68,7 @@ describe('DataSourceWithBackend', () => {
"type": "dummy",
"uid": "abc",
},
"datasourceId": 1234,
"intervalMs": 5000,
"maxDataPoints": 10,
"refId": "A",
@@ -77,6 +78,7 @@ describe('DataSourceWithBackend', () => {
"type": "sample",
"uid": "?",
},
"datasourceId": undefined,
"intervalMs": 5000,
"maxDataPoints": 10,
"refId": "B",
@@ -109,6 +109,7 @@ class DataSourceWithBackend<
const queries = targets.map((q) => {
let datasource = this.getRef();
let datasourceId = this.id;
if (isExpressionReference(q.datasource)) {
return {
@@ -125,11 +126,13 @@ class DataSourceWithBackend<
}
datasource = ds.rawRef ?? getDataSourceRef(ds);
datasourceId = ds.id;
}
return {
...this.applyTemplateVariables(q, request.scopedVars),
datasource,
datasourceId, // deprecated!
intervalMs,
maxDataPoints,
};