[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 <bogdan.matei@grafana.com>

---------

Co-authored-by: Bogdan Matei <bogdan.matei@grafana.com>
pull/97342/head
Javier Ruiz 6 months ago committed by GitHub
parent b7066aa7dc
commit 016351c7ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      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<PromQuery>): Promise<MetricFindValue[]> {
if (config.featureToggles.promQLScope && !!options) {
if (config.featureToggles.promQLScope && (options?.scopes?.length ?? 0) > 0) {
const suggestions = await this.languageProvider.fetchSuggestions(
options.timeRange,
options.queries,

Loading…
Cancel
Save