Add support for PagerDuty

This commit is contained in:
TwinProduction
2020-09-16 19:26:19 -04:00
parent cf6a74f862
commit 75b7a41c9d
7 changed files with 390 additions and 237 deletions

View File

@ -46,7 +46,8 @@ type Service struct {
// Alerts is the alerting configuration for the service in case of failure
Alerts []*Alert `yaml:"alerts"`
NumberOfFailuresInARow int
NumberOfFailuresInARow int
NumberOfSuccessesInARow int
}
func (service *Service) Validate() {
@ -64,6 +65,9 @@ func (service *Service) Validate() {
if alert.Threshold <= 0 {
alert.Threshold = 3
}
if alert.SuccessBeforeResolved <= 0 {
alert.SuccessBeforeResolved = 2
}
}
if len(service.Url) == 0 {
panic(ErrNoUrl)