Alerting: Emit warning when creating or updating unusually large groups (#82279)

* Add config for limit of rules per rule group

* Warn when editing big groups through normal API

* Warn on prov api writes for groups

* Wire up comp root, tests

* Also add warning to state manager warm

* Drop unnecessary conversion
This commit is contained in:
Alexander Weaver
2024-02-13 08:29:03 -06:00
committed by GitHub
parent 556d531c8d
commit 99fa064576
9 changed files with 70 additions and 2 deletions
+4
View File
@@ -101,6 +101,7 @@ type UnifiedAlertingSettings struct {
// MaxStateSaveConcurrency controls the number of goroutines (per rule) that can save alert state in parallel.
MaxStateSaveConcurrency int
StatePeriodicSaveInterval time.Duration
RulesPerRuleGroupLimit int64
}
// RemoteAlertmanagerSettings contains the configuration needed
@@ -352,6 +353,9 @@ func (cfg *Cfg) ReadUnifiedAlertingSettings(iniFile *ini.File) error {
uaCfg.DefaultRuleEvaluationInterval = uaMinInterval
}
quotas := iniFile.Section("quota")
uaCfg.RulesPerRuleGroupLimit = quotas.Key("alerting_rule_group_rules").MustInt64(100)
remoteAlertmanager := iniFile.Section("remote.alertmanager")
uaCfgRemoteAM := RemoteAlertmanagerSettings{
Enable: remoteAlertmanager.Key("enabled").MustBool(false),