Webhook name |
Required. The custom webhook name. |
Post and Get |
Required. The request method. The requested URL cannot exceed 100 characters in length.
In this example, select Post and paste the webhook URL that is saved in the Step 1: Obtain a webhook URL section to the field.
|
Header and Param |
Optional. The request header. The length cannot exceed 200 characters in length. Click
Add to add a header or parameter. The default request header is Content-Type: text/plain; charset=UTF-8. The total number of headers and parameters cannot exceed six.
In this example, set the following two headers:
- Arms-Content-Type : json
- Content-Type : application/json
|
Notification template |
Optional. Specify the content to be sent when the alert is triggered. This parameter
appears only when Post is selected. You can use the $content placeholder to specify
the notification content. The content cannot exceed 500 characters in length. Specify
the notification content in the following format:{
"Alert name":"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}",
"Cluster name":"{{ .commonLabels.clustername }} {{ end }}{{if eq "app" .commonLabels._aliyun_arms_involvedObject_kind }}",
"Application name":"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}",
"Notification policy":"{{ .dispatchRuleName }}",
"Alert time":"{{ .startTime }}",
"Notification content":"{{ for .alerts }} {{ .annotations.message }} {{ end }}"
}
In this example where Feishu is used, specify the notification content in the following
format: {
"msg_type": "text",
"content": {
"text": "Alert name: {{ .commonLabels.alertname }}\nAlert time: {{ .startTime }}\nNotification content: {{ for .alerts }} {{ .annotations.message }} {{if .generatorURL }} Details link: {{.generatorURL}} {{ end }} \n {{ end }}"
}
}
|
Restore Template |
Optional. Specify the content to be sent when the alert is resolved. This parameter
appears only when Post is selected. You can use the $content placeholder to specify
the notification content. The content cannot exceed 500 characters in length. Specify
the notification content in the following format:{
"Alert name":"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}",
"Cluster name":"{{ .commonLabels.clustername }} {{ end }}{{if eq "app" .commonLabels._aliyun_arms_involvedObject_kind }}",
"Application name":"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}",
"Notification policy":"{{ .dispatchRuleName }}",
"Time when the alert is resolved":"{{ .endTime }}",
"Notification content":"{{ for .alerts }} {{ .annotations.message }} {{ end }}"
}
In this example where Feishu is used, specify the notification content in the following
format: {
"msg_type": "text",
"content": {
"text": "Alert name: {{ .commonLabels.alertname }}\nTime when the alert is resolved: {{ .endTime }}\nNotification content: {{ for .alerts }} {{ .annotations.message }} {{if .generatorURL }} Details link: {{.generatorURL}} {{ end }} \n {{ end }}"
}
}
|