[Alerting]: alertmanager notifier fixes (#34575)

This commit is contained in:
Sofia Papagiannaki 2021-05-24 16:09:29 +03:00 committed by GitHub
parent a0b78313f3
commit b48832c0f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 2 deletions

View File

@ -442,6 +442,8 @@ func (am *Alertmanager) buildReceiverIntegrations(receiver *apimodels.PostableAp
n, err = channels.NewThreemaNotifier(cfg, tmpl) n, err = channels.NewThreemaNotifier(cfg, tmpl)
case "opsgenie": case "opsgenie":
n, err = channels.NewOpsgenieNotifier(cfg, tmpl) n, err = channels.NewOpsgenieNotifier(cfg, tmpl)
case "prometheus-alertmanager":
n, err = channels.NewAlertmanagerNotifier(cfg, tmpl)
default: default:
return nil, fmt.Errorf("notifier %s is not supported", r.Type) return nil, fmt.Errorf("notifier %s is not supported", r.Type)
} }

View File

@ -638,7 +638,7 @@ func GetAvailableNotifiers() []*alerting.NotifierPlugin {
}, },
}, },
{ {
Type: "alertmanager", Type: "prometheus-alertmanager",
Name: "Alertmanager", Name: "Alertmanager",
Description: "Sends notifications to Alertmanager", Description: "Sends notifications to Alertmanager",
Heading: "Alertmanager Settings", Heading: "Alertmanager Settings",
@ -651,6 +651,19 @@ func GetAvailableNotifiers() []*alerting.NotifierPlugin {
PropertyName: "url", PropertyName: "url",
Required: true, 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,
},
}, },
}, },
{ {

View File

@ -1291,7 +1291,7 @@ var expAvailableChannelJsonOutput = `
] ]
}, },
{ {
"type": "alertmanager", "type": "prometheus-alertmanager",
"name": "Alertmanager", "name": "Alertmanager",
"heading": "Alertmanager Settings", "heading": "Alertmanager Settings",
"description": "Sends notifications to Alertmanager", "description": "Sends notifications to Alertmanager",
@ -1312,6 +1312,38 @@ var expAvailableChannelJsonOutput = `
"required": true, "required": true,
"validationRule": "", "validationRule": "",
"secure": false "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
} }
] ]
}, },