diff --git a/pkg/services/ngalert/notifier/alertmanager.go b/pkg/services/ngalert/notifier/alertmanager.go index 31759307427..c286e015891 100644 --- a/pkg/services/ngalert/notifier/alertmanager.go +++ b/pkg/services/ngalert/notifier/alertmanager.go @@ -442,6 +442,8 @@ func (am *Alertmanager) buildReceiverIntegrations(receiver *apimodels.PostableAp n, err = channels.NewThreemaNotifier(cfg, tmpl) case "opsgenie": n, err = channels.NewOpsgenieNotifier(cfg, tmpl) + case "prometheus-alertmanager": + n, err = channels.NewAlertmanagerNotifier(cfg, tmpl) default: return nil, fmt.Errorf("notifier %s is not supported", r.Type) } diff --git a/pkg/services/ngalert/notifier/available_channels.go b/pkg/services/ngalert/notifier/available_channels.go index 84014630ae9..6fbbb6962b3 100644 --- a/pkg/services/ngalert/notifier/available_channels.go +++ b/pkg/services/ngalert/notifier/available_channels.go @@ -638,7 +638,7 @@ func GetAvailableNotifiers() []*alerting.NotifierPlugin { }, }, { - Type: "alertmanager", + Type: "prometheus-alertmanager", Name: "Alertmanager", Description: "Sends notifications to Alertmanager", Heading: "Alertmanager Settings", @@ -651,6 +651,19 @@ func GetAvailableNotifiers() []*alerting.NotifierPlugin { PropertyName: "url", Required: true, }, + { + Label: "Basic Auth User", + Element: alerting.ElementTypeInput, + InputType: alerting.InputTypeText, + PropertyName: "basicAuthUser", + }, + { + Label: "Basic Auth Password", + Element: alerting.ElementTypeInput, + InputType: alerting.InputTypePassword, + PropertyName: "basicAuthPassword", + Secure: true, + }, }, }, { diff --git a/pkg/tests/api/alerting/api_available_channel_test.go b/pkg/tests/api/alerting/api_available_channel_test.go index c891c42a220..57e225d3f85 100644 --- a/pkg/tests/api/alerting/api_available_channel_test.go +++ b/pkg/tests/api/alerting/api_available_channel_test.go @@ -1291,7 +1291,7 @@ var expAvailableChannelJsonOutput = ` ] }, { - "type": "alertmanager", + "type": "prometheus-alertmanager", "name": "Alertmanager", "heading": "Alertmanager Settings", "description": "Sends notifications to Alertmanager", @@ -1312,6 +1312,38 @@ var expAvailableChannelJsonOutput = ` "required": true, "validationRule": "", "secure": false + }, + { + "element": "input", + "inputType": "text", + "label": "Basic Auth User", + "description": "", + "placeholder": "", + "propertyName": "basicAuthUser", + "selectOptions": null, + "showWhen": { + "field": "", + "is": "" + }, + "required": false, + "validationRule": "", + "secure": false + }, + { + "element": "input", + "inputType": "password", + "label": "Basic Auth Password", + "description": "", + "placeholder": "", + "propertyName": "basicAuthPassword", + "selectOptions": null, + "showWhen": { + "field": "", + "is": "" + }, + "required": false, + "validationRule": "", + "secure": true } ] },