diff --git a/public/app/plugins/datasource/prometheus/components/PromExploreExtraField.tsx b/public/app/plugins/datasource/prometheus/components/PromExploreExtraField.tsx index 80bcf7c971f..fccf7150c84 100644 --- a/public/app/plugins/datasource/prometheus/components/PromExploreExtraField.tsx +++ b/public/app/plugins/datasource/prometheus/components/PromExploreExtraField.tsx @@ -34,7 +34,12 @@ export const PromExploreExtraField: React.FC = memo( )} aria-label="Query type field" > - Query type + + Query type + diff --git a/public/app/plugins/datasource/prometheus/components/PromExploreQueryEditor.tsx b/public/app/plugins/datasource/prometheus/components/PromExploreQueryEditor.tsx index 171fa9f0c58..e94ecedda65 100644 --- a/public/app/plugins/datasource/prometheus/components/PromExploreQueryEditor.tsx +++ b/public/app/plugins/datasource/prometheus/components/PromExploreQueryEditor.tsx @@ -57,7 +57,8 @@ export const PromExploreQueryEditor: FC = (props: Props) => { data={data} ExtraFieldElement={ } diff --git a/public/app/plugins/datasource/prometheus/datasource.ts b/public/app/plugins/datasource/prometheus/datasource.ts index ee3f3e40b40..2241b9c9ab6 100644 --- a/public/app/plugins/datasource/prometheus/datasource.ts +++ b/public/app/plugins/datasource/prometheus/datasource.ts @@ -171,8 +171,8 @@ export class PrometheusDatasource extends DataSourceApi target.requestId = options.panelId + target.refId; - if (target.range && target.instant) { - // If running both (only available in Explore) - instant and range query, prepare both targets + // In Explore, we run both (instant and range) queries if both are true (selected) or both are undefined (legacy Explore queries) + if (options.app === CoreApp.Explore && target.range === target.instant) { // Create instant target const instantTarget: any = cloneDeep(target); instantTarget.format = 'table'; @@ -194,8 +194,8 @@ export class PrometheusDatasource extends DataSourceApi this.createQuery(instantTarget, options, start, end), this.createQuery(rangeTarget, options, start, end) ); - } else if (target.instant && options.app === CoreApp.Explore) { // If running only instant query in Explore, format as table + } else if (target.instant && options.app === CoreApp.Explore) { const instantTarget: any = cloneDeep(target); instantTarget.format = 'table'; queries.push(this.createQuery(instantTarget, options, start, end));