Alerting: use hash of labels instead of labels string as the alert state cache key (#88956)

* Alerting: use hash instead of labels as the cache key
* Use data.Labels.Fingerprint to calculate the cache key
This commit is contained in:
Alexander Akhmetov
2024-06-11 18:34:58 +02:00
committed by GitHub
parent d004f8a98d
commit 667fea6623
11 changed files with 72 additions and 81 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ func (e *Engine) Test(ctx context.Context, user identity.Requester, rule *models
start := time.Now()
tsField := data.NewField("Time", nil, make([]time.Time, length))
valueFields := make(map[string]*data.Field)
valueFields := make(map[data.Fingerprint]*data.Field)
err = evaluator.Eval(ruleCtx, from, time.Duration(rule.IntervalSeconds)*time.Second, length, func(idx int, currentTime time.Time, results eval.Results) error {
if idx >= length {