From 8fd4fcb987b88da08b9ec7f3ae7e72a3f97363ea Mon Sep 17 00:00:00 2001 From: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com> Date: Thu, 6 Oct 2022 09:26:08 -0500 Subject: [PATCH] Prometheus: Annotation query filtering values less then 1 (#53969) * prevent annotation query from filtering values less then 1 * unit tests were asserting that gaps in data (0 value) are removed from annotation, update filter to exclude 0 --- public/app/plugins/datasource/prometheus/datasource.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/prometheus/datasource.tsx b/public/app/plugins/datasource/prometheus/datasource.tsx index 166689782aa..8bf6393a556 100644 --- a/public/app/plugins/datasource/prometheus/datasource.tsx +++ b/public/app/plugins/datasource/prometheus/datasource.tsx @@ -796,7 +796,7 @@ export class PrometheusDatasource timeValueTuple.push([timeStampValue, valueValue]); }); - const activeValues = timeValueTuple.filter((value) => value[1] >= 1); + const activeValues = timeValueTuple.filter((value) => value[1] > 0); const activeValuesTimestamps = activeValues.map((value) => value[0]); // Instead of creating singular annotation for each active event we group events into region if they are less