diff --git a/dispatch/route.go b/dispatch/route.go index bb6477dd..bcb3f5ae 100644 --- a/dispatch/route.go +++ b/dispatch/route.go @@ -34,6 +34,7 @@ var DefaultRouteOpts = RouteOpts{ RepeatInterval: 4 * time.Hour, GroupBy: map[model.LabelName]struct{}{}, GroupByAll: false, + MuteTimes: []string{}, } // A Route is a node that contains definitions of how to handle alerts. @@ -65,6 +66,7 @@ func NewRoute(cr *config.Route, parent *Route) *Route { if cr.Receiver != "" { opts.Receiver = cr.Receiver } + if cr.GroupBy != nil { opts.GroupBy = map[model.LabelName]struct{}{} for _, ln := range cr.GroupBy { @@ -115,6 +117,8 @@ func NewRoute(cr *config.Route, parent *Route) *Route { sort.Sort(matchers) + opts.MuteTimes = cr.MuteTimes + route := &Route{ parent: parent, RouteOpts: opts, @@ -203,6 +207,9 @@ type RouteOpts struct { GroupWait time.Duration GroupInterval time.Duration RepeatInterval time.Duration + + // A list of time intervals for which the route is muted + MuteTimes []string } func (ro *RouteOpts) String() string {