From 732c2ebb37f3597bb5eb1e154e7c31a438fdd875 Mon Sep 17 00:00:00 2001 From: Tharun Rajendran Date: Mon, 24 Jan 2022 14:52:06 +0530 Subject: [PATCH] Explore: show scalar data result in a table instead of graph (#44362) Signed-off-by: tharun --- .../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 f7c3ed4d9db..80b29d4292c 100644 --- a/public/app/plugins/datasource/prometheus/result_transformer.ts +++ b/public/app/plugins/datasource/prometheus/result_transformer.ts @@ -44,8 +44,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; }