Tempo: Allow usage of template vars with service map query (#79382)

* Apply template vars to serviceMapQuery

* Add test
This commit is contained in:
Joey 2023-12-15 09:03:00 +00:00 committed by GitHub
parent d1db163bb5
commit f053cc7aae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -79,6 +79,7 @@ describe('Tempo data source', () => {
search: '$interpolationVar',
minDuration: '$interpolationVar',
maxDuration: '$interpolationVar',
serviceMapQuery: '$interpolationVar',
filters: [],
};
}
@ -111,6 +112,7 @@ describe('Tempo data source', () => {
expect(queries[0].search).toBe(text);
expect(queries[0].minDuration).toBe(text);
expect(queries[0].maxDuration).toBe(text);
expect(queries[0].serviceMapQuery).toBe(text);
});
it('when traceId query for template variable', async () => {

View File

@ -533,6 +533,7 @@ export class TempoDatasource extends DataSourceWithBackend<TempoQuery, TempoJson
search: this.templateSrv.replace(query.search ?? '', scopedVars),
minDuration: this.templateSrv.replace(query.minDuration ?? '', scopedVars),
maxDuration: this.templateSrv.replace(query.maxDuration ?? '', scopedVars),
serviceMapQuery: this.templateSrv.replace(query.serviceMapQuery ?? '', scopedVars),
};
}