From 3699326b3bd6c9a39cfe440ed1bb8ac81fd70c43 Mon Sep 17 00:00:00 2001 From: Darko Atanasovski Date: Thu, 8 Jan 2026 00:40:29 +0100 Subject: [PATCH] fix the index out of range bug --- pkg/utils/parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/utils/parser.go b/pkg/utils/parser.go index 3c8b185..af638b2 100644 --- a/pkg/utils/parser.go +++ b/pkg/utils/parser.go @@ -80,7 +80,7 @@ func (dest *ScrapeResponse) Merge(fresh ScrapeResponse, window time.Duration) { for _, newPt := range freshGauge.Points { key := minuteKey(newPt.Labels, newPt.Ts) - if existingIdx, ok := minuteIndex[key]; ok { + if existingIdx, ok := minuteIndex[key]; ok && existingIdx < len(destGauge.Points) { destGauge.Points[existingIdx].Value = newPt.Value } else { destGauge.Points = append(destGauge.Points, newPt)