diff --git a/CHANGELOG.md b/CHANGELOG.md index e0a9eb824c5..912a81d3db8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ * [BUGFIX] Fixed ingesters with less tokens stuck in LEAVING. #5061 * [BUGFIX] Tracing: Fix missing object storage span instrumentation. #5074 * [BUGFIX] Ingester: Ingesters returning empty response for metadata APIs. #5081 +* [FEATURE] Alertmanager: Add support for time_intervals. #5102 ## 1.14.0 2022-12-02 diff --git a/pkg/alertmanager/alertmanager.go b/pkg/alertmanager/alertmanager.go index 5cb46ca5927..33a34076a48 100644 --- a/pkg/alertmanager/alertmanager.go +++ b/pkg/alertmanager/alertmanager.go @@ -368,9 +368,13 @@ func (am *Alertmanager) ApplyConfig(userID string, conf *config.Config, rawCfg s return nil } - muteTimes := make(map[string][]timeinterval.TimeInterval, len(conf.MuteTimeIntervals)) + timeIntervals := make(map[string][]timeinterval.TimeInterval, len(conf.MuteTimeIntervals)+len(conf.TimeIntervals)) for _, ti := range conf.MuteTimeIntervals { - muteTimes[ti.Name] = ti.TimeIntervals + timeIntervals[ti.Name] = ti.TimeIntervals + } + + for _, ti := range conf.TimeIntervals { + timeIntervals[ti.Name] = ti.TimeIntervals } pipeline := am.pipelineBuilder.New( @@ -378,7 +382,7 @@ func (am *Alertmanager) ApplyConfig(userID string, conf *config.Config, rawCfg s waitFunc, am.inhibitor, silence.NewSilencer(am.silences, am.marker, am.logger), - muteTimes, + timeIntervals, am.nflog, am.state, )