Skip to content

Commit bfb1f94

Browse files
authored
allow time interval for alert manager (#5102)
* allow time interval for alert manager Signed-off-by: Yijie Qin <qinyijie@amazon.com> * change log update Signed-off-by: Yijie Qin <qinyijie@amazon.com> * fix lint Signed-off-by: Yijie Qin <qinyijie@amazon.com> --------- Signed-off-by: Yijie Qin <qinyijie@amazon.com>
1 parent 229ec97 commit bfb1f94

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* [BUGFIX] Fixed ingesters with less tokens stuck in LEAVING. #5061
3030
* [BUGFIX] Tracing: Fix missing object storage span instrumentation. #5074
3131
* [BUGFIX] Ingester: Ingesters returning empty response for metadata APIs. #5081
32+
* [FEATURE] Alertmanager: Add support for time_intervals. #5102
3233

3334
## 1.14.0 2022-12-02
3435

pkg/alertmanager/alertmanager.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,17 +368,21 @@ func (am *Alertmanager) ApplyConfig(userID string, conf *config.Config, rawCfg s
368368
return nil
369369
}
370370

371-
muteTimes := make(map[string][]timeinterval.TimeInterval, len(conf.MuteTimeIntervals))
371+
timeIntervals := make(map[string][]timeinterval.TimeInterval, len(conf.MuteTimeIntervals)+len(conf.TimeIntervals))
372372
for _, ti := range conf.MuteTimeIntervals {
373-
muteTimes[ti.Name] = ti.TimeIntervals
373+
timeIntervals[ti.Name] = ti.TimeIntervals
374+
}
375+
376+
for _, ti := range conf.TimeIntervals {
377+
timeIntervals[ti.Name] = ti.TimeIntervals
374378
}
375379

376380
pipeline := am.pipelineBuilder.New(
377381
integrationsMap,
378382
waitFunc,
379383
am.inhibitor,
380384
silence.NewSilencer(am.silences, am.marker, am.logger),
381-
muteTimes,
385+
timeIntervals,
382386
am.nflog,
383387
am.state,
384388
)

0 commit comments

Comments
 (0)