querier.Select cannot return a nil series set.
Signed-off-by: gotjosh <josue.abreu@gmail.com>
This commit is contained in:
parent
05ca082b07
commit
379dec9d36
|
@ -675,18 +675,18 @@ func (g *Group) RestoreForState(ts time.Time) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// No results for this alert rule.
|
|
||||||
if sset == nil {
|
|
||||||
level.Debug(g.logger).Log("msg", "Failed to find a series to restore the 'for' state", labels.AlertName, alertRule.Name())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// While not technically the same number of series we expect, it's as good of an approximation as any.
|
// While not technically the same number of series we expect, it's as good of an approximation as any.
|
||||||
seriesByLabels := make(map[string]storage.Series, alertRule.ActiveAlertsCount())
|
seriesByLabels := make(map[string]storage.Series, alertRule.ActiveAlertsCount())
|
||||||
for sset.Next() {
|
for sset.Next() {
|
||||||
seriesByLabels[sset.At().Labels().DropMetricName().String()] = sset.At()
|
seriesByLabels[sset.At().Labels().DropMetricName().String()] = sset.At()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No results for this alert rule.
|
||||||
|
if len(seriesByLabels) == 0 {
|
||||||
|
level.Debug(g.logger).Log("msg", "Failed to find a series to restore the 'for' state", labels.AlertName, alertRule.Name())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
alertRule.ForEachActiveAlert(func(a *Alert) {
|
alertRule.ForEachActiveAlert(func(a *Alert) {
|
||||||
var s storage.Series
|
var s storage.Series
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue