Alerting: Add setting for maximum allowed rule evaluation results (#89468)

* Alerting: Add setting for maximum allowed rule evaluation results

Added a new configuration setting `quota.alerting_rule_evaluation_results` to set the maximum number of alert rule evaluation results per rule. If the limit is exceeded, the evaluation will result in an error.
This commit is contained in:
Alexander Akhmetov
2024-06-27 09:45:15 +02:00
committed by GitHub
parent be1414b36b
commit 68691c9386
6 changed files with 183 additions and 9 deletions

View File

@@ -91,6 +91,7 @@ type UnifiedAlertingSettings struct {
MaxAttempts int64
MinInterval time.Duration
EvaluationTimeout time.Duration
EvaluationResultLimit int
DisableJitter bool
ExecuteAlerts bool
DefaultConfiguration string
@@ -355,6 +356,7 @@ func (cfg *Cfg) ReadUnifiedAlertingSettings(iniFile *ini.File) error {
quotas := iniFile.Section("quota")
uaCfg.RulesPerRuleGroupLimit = quotas.Key("alerting_rule_group_rules").MustInt64(100)
uaCfg.EvaluationResultLimit = quotas.Key("alerting_rule_evaluation_results").MustInt(-1)
remoteAlertmanager := iniFile.Section("remote.alertmanager")
uaCfgRemoteAM := RemoteAlertmanagerSettings{