1
0
mirror of https://github.com/prometheus/alertmanager.git synced 2026-10-23 08:48:56 +03:00
Files
Guido Trotter b7edc13cfd notify, dispatch: report both active and mute time intervals for a group
MutedByTimeIntervals stopped after the active time intervals muted a
group, mirroring the pipeline where the TimeMuteStage never runs after
the TimeActiveStage drops the alerts. For a query that only explains
why a group is muted, hiding the mute time intervals loses information
for no benefit.

Evaluate both kinds and return one slice per kind: the active time
intervals when now is outside all of them, and the mute time intervals
that contain now. The group is still muted exactly when the pipeline
would mute it. Carry both on dispatch.AlertGroup as
MutedByActiveTimeIntervals and MutedByMuteTimeIntervals so that a future
API version can report them separately. The v2 API, whose mutedBy field
is a single list, flattens them through the new AlertGroup.MutedBy
method, active names first. That method concatenates with slices.Concat
because the active names alias the route's own slice.

Add a unit test for the combinations, cover the flattening, and update
the dispatcher and pipeline tests that pinned the old precedence.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Guido Trotter <guido@hudson-trading.com>
2026-10-22 16:09:24 +01:00
..