From c1d674a2c6649dbfe4c85c120a39ae9b017f2a31 Mon Sep 17 00:00:00 2001 From: Leon Sorokin Date: Fri, 27 Oct 2023 12:31:21 -0500 Subject: [PATCH] Prometheus: Don't post-process native heatmap-cells responses (#77289) --- .../plugins/datasource/prometheus/result_transformer.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/datasource/prometheus/result_transformer.ts b/public/app/plugins/datasource/prometheus/result_transformer.ts index 59308d9208c..e8174be5fd2 100644 --- a/public/app/plugins/datasource/prometheus/result_transformer.ts +++ b/public/app/plugins/datasource/prometheus/result_transformer.ts @@ -58,7 +58,11 @@ const isTableResult = (dataFrame: DataFrame, options: DataQueryRequest): boolean => { +const isCumulativeHeatmapResult = (dataFrame: DataFrame, options: DataQueryRequest): boolean => { + if (dataFrame.meta?.type === DataFrameType.HeatmapCells) { + return false; + } + const target = options.targets.find((target) => target.refId === dataFrame.refId); return target?.format === 'heatmap'; }; @@ -114,7 +118,7 @@ export function transformV2( const [heatmapResults, framesWithoutTableHeatmapsAndExemplars] = partition( framesWithoutTableAndExemplars, - (df) => isHeatmapResult(df, request) + (df) => isCumulativeHeatmapResult(df, request) ); // this works around the fact that we only get back frame.name with le buckets when legendFormat == {{le}}...which is not the default