From 6e078879ce4ed029e77d79c749b4e41f5e1f8f29 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 8 Dec 2022 21:32:28 +0000 Subject: [PATCH] [v9.3.x] Prometheus: Exemplar optimization (#60057) replace inefficient forEach (cherry picked from commit e85763065cac63ddb0bec4c96a7d2b802eab8e13) Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com> --- .../app/plugins/panel/timeseries/plugins/ExemplarsPlugin.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/panel/timeseries/plugins/ExemplarsPlugin.tsx b/public/app/plugins/panel/timeseries/plugins/ExemplarsPlugin.tsx index 91d3647cae8..8f15fae1e88 100644 --- a/public/app/plugins/panel/timeseries/plugins/ExemplarsPlugin.tsx +++ b/public/app/plugins/panel/timeseries/plugins/ExemplarsPlugin.tsx @@ -181,7 +181,7 @@ const showExemplarMarker = ( if (visibleSeries.labels.length === visibleSeries.totalSeriesCount) { showMarker = true; } else { - visibleSeries.labels.forEach((visibleLabel) => { + visibleSeries.labels.some((visibleLabel) => { // Get the label names const labelKeys = Object.keys(visibleLabel.labels); @@ -204,6 +204,7 @@ const showExemplarMarker = ( }); } } + return showMarker; }); } return showMarker;