From 7b29242600073428db2983905414450583b2d3ec Mon Sep 17 00:00:00 2001 From: Joey <90795735+joey-grafana@users.noreply.github.com> Date: Wed, 3 Jul 2024 13:55:33 +0100 Subject: [PATCH] Tempo: Fix query history (#89991) Fix query history for Tempo queries --- public/app/plugins/datasource/tempo/datasource.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/public/app/plugins/datasource/tempo/datasource.ts b/public/app/plugins/datasource/tempo/datasource.ts index d287cae6459..93db409c37f 100644 --- a/public/app/plugins/datasource/tempo/datasource.ts +++ b/public/app/plugins/datasource/tempo/datasource.ts @@ -1,4 +1,4 @@ -import { groupBy, startCase } from 'lodash'; +import { groupBy } from 'lodash'; import { EMPTY, from, lastValueFrom, merge, Observable, of } from 'rxjs'; import { catchError, concatMap, map, mergeMap, toArray } from 'rxjs/operators'; import semver from 'semver'; @@ -738,17 +738,12 @@ export class TempoDatasource extends DataSourceWithBackend - > = ['serviceName', 'spanName', 'search', 'minDuration', 'maxDuration', 'limit']; - return keys - .filter((key) => query[key]) - .map((key) => `${startCase(key)}: ${query[key]}`) - .join(', '); + const appliedQuery = this.applyVariables(query, {}); + return generateQueryFromFilters(appliedQuery.filters); } }