Log a warning when repeat_interval is less than group_interval (#3389)

* Log a warning when repeat_interval is less than group_interval

This commit updates Alertmanager to log a warning when
repeat_interval is less than group_interval for an individual route.

When repeat_interval is less than group_interval, the earliest
a notification can be sent again is the next time the aggregation
group is flushed, and this happens at each group_interval.

Signed-off-by: George Robinson <george.robinson@grafana.com>
---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
Co-authored-by: gotjosh <josue.abreu@gmail.com>
This commit is contained in:
George Robinson 2023-06-08 21:58:24 +01:00 committed by GitHub
parent d10f21f38c
commit 229ecb7e9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -515,6 +515,19 @@ func run() int {
r.Key(),
)
}
if r.RouteOpts.RepeatInterval < r.RouteOpts.GroupInterval {
level.Warn(configLogger).Log(
"msg",
"repeat_interval is less than group_interval. Notifications will not repeat until the next group_interval.",
"repeat_interval",
r.RouteOpts.RepeatInterval,
"group_interval",
r.RouteOpts.GroupInterval,
"route",
r.Key(),
)
}
})
go disp.Run()

View File

@ -197,7 +197,7 @@ matchers:
# Note that this parameter is implicitly bound by Alertmanager's
# `--data.retention` configuration flag. Notifications will be resent after either
# repeat_interval or the data retention period have passed, whichever
# occurs first.
# occurs first. `repeat_interval` should not be less than `group_interval`.
[ repeat_interval: <duration> | default = 4h ]
# Times when the route should be muted. These must match the name of a