diff --git a/public/app/plugins/datasource/tempo/traceql/autocomplete.ts b/public/app/plugins/datasource/tempo/traceql/autocomplete.ts index 9d98bab5037..b843bb385c2 100644 --- a/public/app/plugins/datasource/tempo/traceql/autocomplete.ts +++ b/public/app/plugins/datasource/tempo/traceql/autocomplete.ts @@ -282,12 +282,13 @@ export class CompletionProvider implements monacoTypes.languages.CompletionItemP private async getTagValues(tagName: string, query: string): Promise>> { let tagValues: Array>; + const cacheKey = `${tagName}:${query}`; - if (this.cachedValues.hasOwnProperty(tagName)) { - tagValues = this.cachedValues[tagName]; + if (this.cachedValues.hasOwnProperty(cacheKey)) { + tagValues = this.cachedValues[cacheKey]; } else { tagValues = await this.languageProvider.getOptionsV2(tagName, query); - this.cachedValues[tagName] = tagValues; + this.cachedValues[cacheKey] = tagValues; } return tagValues; }