Skip to content

Commit 3699326

Browse files
fix the index out of range bug
1 parent 65b6bd6 commit 3699326

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/utils/parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (dest *ScrapeResponse) Merge(fresh ScrapeResponse, window time.Duration) {
8080

8181
for _, newPt := range freshGauge.Points {
8282
key := minuteKey(newPt.Labels, newPt.Ts)
83-
if existingIdx, ok := minuteIndex[key]; ok {
83+
if existingIdx, ok := minuteIndex[key]; ok && existingIdx < len(destGauge.Points) {
8484
destGauge.Points[existingIdx].Value = newPt.Value
8585
} else {
8686
destGauge.Points = append(destGauge.Points, newPt)

0 commit comments

Comments
 (0)