Alerting: Use AlertRuleKey for comparison before rule evaluation (#98808)

(WIP) Alerting: Use AlertRuleKey for comparison before rule evaluation
This commit is contained in:
Santiago
2025-01-10 15:31:03 +01:00
committed by GitHub
parent b742896838
commit 86e8147df3
+1 -1
View File
@@ -194,7 +194,7 @@ func (a *alertRule) Status() ngmodels.RuleStatus {
//
// the second element contains a dropped message that was sent by a concurrent sender.
func (a *alertRule) Eval(eval *Evaluation) (bool, *Evaluation) {
if a.key != eval.rule.GetKeyWithGroup() {
if a.key.AlertRuleKey != eval.rule.GetKey() {
// Make sure that rule has the same key. This should not happen
a.logger.Error("Invalid rule sent for evaluating. Skipping", "ruleKeyToEvaluate", eval.rule.GetKey().String())
return false, eval