bug: nil check against the series set not errors

Signed-off-by: gotjosh <josue.abreu@gmail.com>
This commit is contained in:
gotjosh 2024-04-23 19:49:07 +01:00
parent 4daaa59c08
commit e6dcbd2e26
No known key found for this signature in database
GPG key ID: A6E1DDE38FF3C74E
2 changed files with 2 additions and 2 deletions

View file

@ -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()
}

View file

@ -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
}