From e6dcbd2e26b73c6e4e4e0b8bc89c3d33f7de05c3 Mon Sep 17 00:00:00 2001 From: gotjosh Date: Tue, 23 Apr 2024 19:49:07 +0100 Subject: [PATCH] bug: nil check against the series set not errors Signed-off-by: gotjosh --- rules/alerting.go | 2 +- rules/group.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rules/alerting.go b/rules/alerting.go index 1bcf0a034..2cadd3ac5 100644 --- a/rules/alerting.go +++ b/rules/alerting.go @@ -281,8 +281,8 @@ func (r *AlertingRule) QueryforStateSeries(ctx context.Context, q storage.Querie } matchers = append(matchers, mt) }) - sset := q.Select(ctx, false, nil, matchers...) + sset := q.Select(ctx, false, nil, matchers...) return sset, sset.Err() } diff --git a/rules/group.go b/rules/group.go index 81f7b1df2..7afeaf96e 100644 --- a/rules/group.go +++ b/rules/group.go @@ -676,7 +676,7 @@ func (g *Group) RestoreForState(ts time.Time) { } // No results for this alert rule. - if err == nil { + if sset == nil { level.Debug(g.logger).Log("msg", "Failed to find a series to restore the 'for' state", labels.AlertName, alertRule.Name()) continue }