From eccd87a56406ae019de5a2e92d72779c3e53485c Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Mon, 24 Jan 2022 10:37:24 +0100 Subject: [PATCH] Explore: show scalar data result in a table instead of graph (#44362) (#44366) Signed-off-by: tharun (cherry picked from commit 732c2ebb37f3597bb5eb1e154e7c31a438fdd875) Co-authored-by: Tharun Rajendran --- .../plugins/datasource/prometheus/result_transformer.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/datasource/prometheus/result_transformer.ts b/public/app/plugins/datasource/prometheus/result_transformer.ts index db6553f1056..32d7e7fd05f 100644 --- a/public/app/plugins/datasource/prometheus/result_transformer.ts +++ b/public/app/plugins/datasource/prometheus/result_transformer.ts @@ -43,8 +43,11 @@ interface TimeAndValue { } const isTableResult = (dataFrame: DataFrame, options: DataQueryRequest): boolean => { - // We want to process instant results in Explore as table - if ((options.app === CoreApp.Explore && dataFrame.meta?.custom?.resultType) === 'vector') { + // We want to process vector and scalar results in Explore as table + if ( + options.app === CoreApp.Explore && + (dataFrame.meta?.custom?.resultType === 'vector' || dataFrame.meta?.custom?.resultType === 'scalar') + ) { return true; }