Add support for PagerDuty

This commit is contained in:
TwinProduction committed 2020-09-16 19:26:19 -04:00
1 parent cf6a74f862
commit 75b7a41c9d
7 files changed
+390 -237

No files matched your search

+5 -1
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)