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:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user