feat(alerting): Add new providers for Datadog, IFTTT, Line, NewRelic, Plivo, RocketChat, SendGrid, Signal, SIGNL4, Splunk, Squadcast, Vonage, Webex and Zapier (#1224)
* feat(alerting): Add new providers for Datadog, IFTTT, Line, NewRelic, Plivo, RocketChat, SendGrid, Signal, SIGNL4, Splunk, Squadcast, Vonage, Webex and Zapier Relevant: https://github.com/TwiN/gatus/discussions/1223 Fixes #1073 Fixes #1074 * chore: Clean up code * docs: Fix table formatting * Update alerting/provider/datadog/datadog.go * Update alerting/provider/signal/signal.go * Update alerting/provider/ifttt/ifttt.go * Update alerting/provider/newrelic/newrelic.go * Update alerting/provider/squadcast/squadcast.go * Update alerting/provider/squadcast/squadcast.go
This commit is contained in:
@@ -444,6 +444,7 @@ func validateAlertingConfig(alertingConfig *alerting.Config, endpoints []*endpoi
|
||||
alertTypes := []alert.Type{
|
||||
alert.TypeAWSSES,
|
||||
alert.TypeCustom,
|
||||
alert.TypeDatadog,
|
||||
alert.TypeDiscord,
|
||||
alert.TypeEmail,
|
||||
alert.TypeGitHub,
|
||||
@@ -452,21 +453,34 @@ func validateAlertingConfig(alertingConfig *alerting.Config, endpoints []*endpoi
|
||||
alert.TypeGoogleChat,
|
||||
alert.TypeGotify,
|
||||
alert.TypeHomeAssistant,
|
||||
alert.TypeIFTTT,
|
||||
alert.TypeIlert,
|
||||
alert.TypeIncidentIO,
|
||||
alert.TypeJetBrainsSpace,
|
||||
alert.TypeLine,
|
||||
alert.TypeMatrix,
|
||||
alert.TypeMattermost,
|
||||
alert.TypeMessagebird,
|
||||
alert.TypeNewRelic,
|
||||
alert.TypeNtfy,
|
||||
alert.TypeOpsgenie,
|
||||
alert.TypePagerDuty,
|
||||
alert.TypePlivo,
|
||||
alert.TypePushover,
|
||||
alert.TypeRocketChat,
|
||||
alert.TypeSendGrid,
|
||||
alert.TypeSignal,
|
||||
alert.TypeSIGNL4,
|
||||
alert.TypeSlack,
|
||||
alert.TypeSplunk,
|
||||
alert.TypeSquadcast,
|
||||
alert.TypeTeams,
|
||||
alert.TypeTeamsWorkflows,
|
||||
alert.TypeTelegram,
|
||||
alert.TypeTwilio,
|
||||
alert.TypeVonage,
|
||||
alert.TypeWebex,
|
||||
alert.TypeZapier,
|
||||
alert.TypeZulip,
|
||||
}
|
||||
var validProviders, invalidProviders []alert.Type
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/TwiN/gatus/v5/alerting/provider"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/awsses"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/custom"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/datadog"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/discord"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/email"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/gitea"
|
||||
@@ -20,19 +21,35 @@ import (
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/gitlab"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/googlechat"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/gotify"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/homeassistant"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/ifttt"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/ilert"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/incidentio"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/jetbrainsspace"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/line"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/matrix"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/mattermost"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/messagebird"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/newrelic"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/ntfy"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/opsgenie"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/pagerduty"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/plivo"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/pushover"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/rocketchat"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/sendgrid"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/signal"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/signl4"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/slack"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/splunk"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/squadcast"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/teams"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/teamsworkflows"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/telegram"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/twilio"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/vonage"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/webex"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/zapier"
|
||||
"github.com/TwiN/gatus/v5/alerting/provider/zulip"
|
||||
"github.com/TwiN/gatus/v5/client"
|
||||
"github.com/TwiN/gatus/v5/config/endpoint"
|
||||
@@ -1885,6 +1902,7 @@ func TestGetAlertingProviderByAlertType(t *testing.T) {
|
||||
alertingConfig := &alerting.Config{
|
||||
AWSSimpleEmailService: &awsses.AlertProvider{},
|
||||
Custom: &custom.AlertProvider{},
|
||||
Datadog: &datadog.AlertProvider{},
|
||||
Discord: &discord.AlertProvider{},
|
||||
Email: &email.AlertProvider{},
|
||||
Gitea: &gitea.AlertProvider{},
|
||||
@@ -1892,19 +1910,35 @@ func TestGetAlertingProviderByAlertType(t *testing.T) {
|
||||
GitLab: &gitlab.AlertProvider{},
|
||||
GoogleChat: &googlechat.AlertProvider{},
|
||||
Gotify: &gotify.AlertProvider{},
|
||||
HomeAssistant: &homeassistant.AlertProvider{},
|
||||
IFTTT: &ifttt.AlertProvider{},
|
||||
Ilert: &ilert.AlertProvider{},
|
||||
IncidentIO: &incidentio.AlertProvider{},
|
||||
JetBrainsSpace: &jetbrainsspace.AlertProvider{},
|
||||
Line: &line.AlertProvider{},
|
||||
Matrix: &matrix.AlertProvider{},
|
||||
Mattermost: &mattermost.AlertProvider{},
|
||||
Messagebird: &messagebird.AlertProvider{},
|
||||
NewRelic: &newrelic.AlertProvider{},
|
||||
Ntfy: &ntfy.AlertProvider{},
|
||||
Opsgenie: &opsgenie.AlertProvider{},
|
||||
PagerDuty: &pagerduty.AlertProvider{},
|
||||
Plivo: &plivo.AlertProvider{},
|
||||
Pushover: &pushover.AlertProvider{},
|
||||
RocketChat: &rocketchat.AlertProvider{},
|
||||
SendGrid: &sendgrid.AlertProvider{},
|
||||
Signal: &signal.AlertProvider{},
|
||||
SIGNL4: &signl4.AlertProvider{},
|
||||
Slack: &slack.AlertProvider{},
|
||||
Splunk: &splunk.AlertProvider{},
|
||||
Squadcast: &squadcast.AlertProvider{},
|
||||
Telegram: &telegram.AlertProvider{},
|
||||
Teams: &teams.AlertProvider{},
|
||||
TeamsWorkflows: &teamsworkflows.AlertProvider{},
|
||||
Twilio: &twilio.AlertProvider{},
|
||||
Vonage: &vonage.AlertProvider{},
|
||||
Webex: &webex.AlertProvider{},
|
||||
Zapier: &zapier.AlertProvider{},
|
||||
Zulip: &zulip.AlertProvider{},
|
||||
}
|
||||
scenarios := []struct {
|
||||
@@ -1913,6 +1947,7 @@ func TestGetAlertingProviderByAlertType(t *testing.T) {
|
||||
}{
|
||||
{alertType: alert.TypeAWSSES, expected: alertingConfig.AWSSimpleEmailService},
|
||||
{alertType: alert.TypeCustom, expected: alertingConfig.Custom},
|
||||
{alertType: alert.TypeDatadog, expected: alertingConfig.Datadog},
|
||||
{alertType: alert.TypeDiscord, expected: alertingConfig.Discord},
|
||||
{alertType: alert.TypeEmail, expected: alertingConfig.Email},
|
||||
{alertType: alert.TypeGitea, expected: alertingConfig.Gitea},
|
||||
@@ -1920,19 +1955,35 @@ func TestGetAlertingProviderByAlertType(t *testing.T) {
|
||||
{alertType: alert.TypeGitLab, expected: alertingConfig.GitLab},
|
||||
{alertType: alert.TypeGoogleChat, expected: alertingConfig.GoogleChat},
|
||||
{alertType: alert.TypeGotify, expected: alertingConfig.Gotify},
|
||||
{alertType: alert.TypeHomeAssistant, expected: alertingConfig.HomeAssistant},
|
||||
{alertType: alert.TypeIFTTT, expected: alertingConfig.IFTTT},
|
||||
{alertType: alert.TypeIlert, expected: alertingConfig.Ilert},
|
||||
{alertType: alert.TypeIncidentIO, expected: alertingConfig.IncidentIO},
|
||||
{alertType: alert.TypeJetBrainsSpace, expected: alertingConfig.JetBrainsSpace},
|
||||
{alertType: alert.TypeLine, expected: alertingConfig.Line},
|
||||
{alertType: alert.TypeMatrix, expected: alertingConfig.Matrix},
|
||||
{alertType: alert.TypeMattermost, expected: alertingConfig.Mattermost},
|
||||
{alertType: alert.TypeMessagebird, expected: alertingConfig.Messagebird},
|
||||
{alertType: alert.TypeNewRelic, expected: alertingConfig.NewRelic},
|
||||
{alertType: alert.TypeNtfy, expected: alertingConfig.Ntfy},
|
||||
{alertType: alert.TypeOpsgenie, expected: alertingConfig.Opsgenie},
|
||||
{alertType: alert.TypePagerDuty, expected: alertingConfig.PagerDuty},
|
||||
{alertType: alert.TypePlivo, expected: alertingConfig.Plivo},
|
||||
{alertType: alert.TypePushover, expected: alertingConfig.Pushover},
|
||||
{alertType: alert.TypeRocketChat, expected: alertingConfig.RocketChat},
|
||||
{alertType: alert.TypeSendGrid, expected: alertingConfig.SendGrid},
|
||||
{alertType: alert.TypeSignal, expected: alertingConfig.Signal},
|
||||
{alertType: alert.TypeSIGNL4, expected: alertingConfig.SIGNL4},
|
||||
{alertType: alert.TypeSlack, expected: alertingConfig.Slack},
|
||||
{alertType: alert.TypeSplunk, expected: alertingConfig.Splunk},
|
||||
{alertType: alert.TypeSquadcast, expected: alertingConfig.Squadcast},
|
||||
{alertType: alert.TypeTelegram, expected: alertingConfig.Telegram},
|
||||
{alertType: alert.TypeTeams, expected: alertingConfig.Teams},
|
||||
{alertType: alert.TypeTeamsWorkflows, expected: alertingConfig.TeamsWorkflows},
|
||||
{alertType: alert.TypeTwilio, expected: alertingConfig.Twilio},
|
||||
{alertType: alert.TypeVonage, expected: alertingConfig.Vonage},
|
||||
{alertType: alert.TypeWebex, expected: alertingConfig.Webex},
|
||||
{alertType: alert.TypeZapier, expected: alertingConfig.Zapier},
|
||||
{alertType: alert.TypeZulip, expected: alertingConfig.Zulip},
|
||||
}
|
||||
for _, scenario := range scenarios {
|
||||
|
||||
Reference in New Issue
Block a user