Skip to content

Commit 3b02e84

Browse files
committed
feat(alertmanager): add support for webex receivers
Signed-off-by: Niclas Schad <[email protected]>
1 parent 18e6e4d commit 3b02e84

File tree

6 files changed

+122
-2
lines changed

6 files changed

+122
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## master / unreleased
4+
* [FEATURE] AlertManager: Add support for Webex Receiver. #5493
45
* [FEATURE] Ingester: added `-admin-limit-message` to customize the message contained in limit errors.#5460
56
* [CHANGE] AlertManager: include reason label in cortex_alertmanager_notifications_failed_total.#5409
67
* [CHANGE] Query: Set CORS Origin headers for Query API #5388

docs/configuration/config-file-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2999,7 +2999,7 @@ The `limits_config` configures default and per-tenant limits imposed by Cortex s
29992999
# is given in JSON format. Rate limit has the same meaning as
30003000
# -alertmanager.notification-rate-limit, but only applies for specific
30013001
# integration. Allowed integration names: webhook, email, pagerduty, opsgenie,
3002-
# wechat, slack, victorops, pushover, sns.
3002+
# wechat, slack, victorops, pushover, sns, webex.
30033003
# CLI flag: -alertmanager.notification-rate-limit-per-integration
30043004
[alertmanager_notification_rate_limit_per_integration: <map of string to float64> | default = {}]
30053005

pkg/alertmanager/alertmanager.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"github.com/prometheus/alertmanager/notify/slack"
3232
"github.com/prometheus/alertmanager/notify/sns"
3333
"github.com/prometheus/alertmanager/notify/victorops"
34+
"github.com/prometheus/alertmanager/notify/webex"
3435
"github.com/prometheus/alertmanager/notify/webhook"
3536
"github.com/prometheus/alertmanager/notify/wechat"
3637
"github.com/prometheus/alertmanager/provider/mem"
@@ -527,6 +528,9 @@ func buildReceiverIntegrations(nc config.Receiver, tmpl *template.Template, fire
527528
for i, c := range nc.SNSConfigs {
528529
add("sns", i, c, func(l log.Logger) (notify.Notifier, error) { return sns.New(c, tmpl, l, httpOps...) })
529530
}
531+
for i, c := range nc.WebexConfigs {
532+
add("webex", i, c, func(l log.Logger) (notify.Notifier, error) { return webex.New(c, tmpl, l, httpOps...) })
533+
}
530534
// If we add support for more integrations, we need to add them to validation as well. See validation.allowedIntegrationNames field.
531535
if errs.Len() > 0 {
532536
return nil, &errs

pkg/util/validation/notifications_limit_flag.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
var allowedIntegrationNames = []string{
13-
"webhook", "email", "pagerduty", "opsgenie", "wechat", "slack", "victorops", "pushover", "sns",
13+
"webhook", "email", "pagerduty", "opsgenie", "wechat", "slack", "victorops", "pushover", "sns", "webex",
1414
}
1515

1616
type NotificationRateLimitMap map[string]float64

vendor/github.com/prometheus/alertmanager/notify/webex/webex.go

Lines changed: 114 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)