mirror of
https://github.com/prometheus/alertmanager
synced 2025-01-11 16:29:30 +00:00
Ensure minimum repeat rate for events.
This commit is contained in:
parent
436643f94e
commit
71a9d4af35
@ -20,6 +20,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
minimumRepeatRate = 5 * time.Minute
|
||||
minimumRefreshPeriod = 5 * time.Minute
|
||||
notificationRetryPeriod = 1 * time.Minute
|
||||
)
|
||||
@ -213,6 +214,13 @@ type aggregatorResetRulesRequest struct {
|
||||
|
||||
func (a *Aggregator) replaceRules(r *aggregatorResetRulesRequest) {
|
||||
log.Println("Replacing", len(r.Rules), "aggregator rules...")
|
||||
|
||||
for _, rule := range r.Rules {
|
||||
if rule.RepeatRate < minimumRepeatRate {
|
||||
log.Println("Rule repeat rate too low, setting to minimum value")
|
||||
rule.RepeatRate = minimumRepeatRate
|
||||
}
|
||||
}
|
||||
a.Rules = r.Rules
|
||||
|
||||
r.Response <- new(aggregatorResetRulesResponse)
|
||||
|
Loading…
Reference in New Issue
Block a user