From 016351c7ed386dc45ae1b817f698805104812beb Mon Sep 17 00:00:00 2001 From: Javier Ruiz Date: Wed, 4 Dec 2024 10:30:32 +0100 Subject: [PATCH] [getTagKeys] Ensure we're not using suggestions when no scopes are present (#97353) * Ensure we're not using suggestions when no scopes are present * Simplify scopes check Co-authored-by: Bogdan Matei --------- Co-authored-by: Bogdan Matei --- packages/grafana-prometheus/src/datasource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grafana-prometheus/src/datasource.ts b/packages/grafana-prometheus/src/datasource.ts index ce24ddcb93f..a2e4b2bd953 100644 --- a/packages/grafana-prometheus/src/datasource.ts +++ b/packages/grafana-prometheus/src/datasource.ts @@ -620,7 +620,7 @@ export class PrometheusDatasource // it is used in metric_find_query.ts // and in Tempo here grafana/public/app/plugins/datasource/tempo/QueryEditor/ServiceGraphSection.tsx async getTagKeys(options: DataSourceGetTagKeysOptions): Promise { - if (config.featureToggles.promQLScope && !!options) { + if (config.featureToggles.promQLScope && (options?.scopes?.length ?? 0) > 0) { const suggestions = await this.languageProvider.fetchSuggestions( options.timeRange, options.queries,