- Add a changelog entry

- Improve variable name of the map produced by the series set

Signed-off-by: gotjosh <josue.abreu@gmail.com>
This commit is contained in:
gotjosh 2024-04-24 19:02:47 +01:00
parent fa75985c1c
commit 6cfc584308
No known key found for this signature in database
GPG Key ID: A6E1DDE38FF3C74E
2 changed files with 4 additions and 3 deletions

View File

@ -3,6 +3,7 @@
## unreleased
* [CHANGE] TSDB: Fix the predicate checking for blocks which are beyond the retention period to include the ones right at the retention boundary. #9633
* [CHANGE] Rules: Execute 1 query instead of N (where N is the number of alerts within alert rule) when restoring alerts. #13980
* [ENHANCEMENT] Rules: Add `rule_group_last_restore_duration_seconds` to measure the time it takes to restore a rule group. #13974
## 2.51.2 / 2024-04-09

View File

@ -681,15 +681,15 @@ func (g *Group) RestoreForState(ts time.Time) {
continue
}
result := map[string]storage.Series{}
seriesByLabels := map[string]storage.Series{}
for sset.Next() {
result[sset.At().Labels().DropMetricName().String()] = sset.At()
seriesByLabels[sset.At().Labels().DropMetricName().String()] = sset.At()
}
alertRule.ForEachActiveAlert(func(a *Alert) {
var s storage.Series
s, ok := result[a.Labels.String()]
s, ok := seriesByLabels[a.Labels.String()]
if !ok {
return
}