Add config timeinterval that allows intervals to be dumped back out on the status page of Alertmanager

Signed-off-by: Ben Ridley <benridley29@gmail.com>
This commit is contained in:
ben 2020-09-27 16:07:47 +10:00 committed by Ben Ridley
parent cbfbf07188
commit 1d912faab6
2 changed files with 13 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
/data/
make_container.sh
/alertmanager
/amtool
*.yml

View File

@ -25,7 +25,6 @@ import (
"strings"
"time"
"github.com/benridley/gotime"
"github.com/pkg/errors"
commoncfg "github.com/prometheus/common/config"
"github.com/prometheus/common/model"
@ -220,10 +219,19 @@ func resolveFilepaths(baseDir string, cfg *Config) {
}
}
// A MuteTimeInterval represents a named set of time intervals for which a route should be muted
// A MuteTimeInterval represents a named set of time intervals for which a route should be muted.
type MuteTimeInterval struct {
Name string `yaml:"name" json:"name"`
TimeIntervals []gotime.TimeInterval `yaml:"time_intervals"`
Name string `yaml:"name" json:"name"`
TimeIntervals []TimeInterval `yaml:"time_intervals"`
}
// A TimeInterval describes intervals of time.
type TimeInterval struct {
Times []string `yaml:"times"`
Weekdays []string `yaml:"weekdays"`
DaysOfMonth []string `yaml:"days_of_month"`
Months []string `yaml:"months"`
Years []string `yaml:"years"`
}
// Config is the top-level configuration for Alertmanager's config files.