[getTagValues] Ensure we're not using suggestions when no scopes are present (#102008)

Ensure we're not using suggestions when no scopes are present
This commit is contained in:
Javier Ruiz
2025-03-12 16:38:22 +01:00
committed by GitHub
parent ee2050d866
commit fe8e4563bd
@@ -691,7 +691,7 @@ export class PrometheusDatasource
// By implementing getTagKeys and getTagValues we add ad-hoc filters functionality
async getTagValues(options: DataSourceGetTagValuesOptions<PromQuery>) {
const requestId = `[${this.uid}][${options.key}]`;
if (config.featureToggles.promQLScope) {
if (config.featureToggles.promQLScope && (options?.scopes?.length ?? 0) > 0) {
return (
await this.languageProvider.fetchSuggestions(
options.timeRange,