Skip to content

Commit 15ba387

Browse files
committed
allow time interval for alert manager
Signed-off-by: Yijie Qin <[email protected]>
1 parent a684a3d commit 15ba387

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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)