In Application Real-Time Monitoring Service (ARMS), you can configure alert notification templates for webhooks. When sending webhook requests, ARMS sends alert notifications in the format used by open-source Alertmanager.
Limits
When you create a webhook in ARMS to send alert notifications, take note of the following limits:
Content-Type must be set to application/json.
You cannot use the
$contentfield together with the$alertmanager_contentfield. If you attempt to do so, the$contentfield does not take effect.When you test a webhook in the ARMS console, you cannot replace the
$alertmanager_contentfield.For more information about how to use a webhook to send alert notifications, see Use a webhook to send custom alert notifications.
Format of alert notifications
The following section describes the format of open-source Alertmanager. ARMS sends webhook-based alert notifications in this format. For more information, see the Prometheus documentation.
{
"alerts": [
{
"annotations": {
"_aliyun_arms_alert_value": "15.521240234375",
"_aliyun_arms_alert_message": "null\n Message ID: ac10c42a16124966960554200d2450-7996494\n",
"_aliyun_arms_alert_now_value": "15.521240234375",
"message": "Alert: Namespace: {{$labels.namespace}} / Pod: {{$labels.pod_name}} / Container: {{$labels.container}} Memory usage > 80%, Current value {{ printf \"%.2f\" $value }}%",
"value": "15.521240234375",
"_aliyun_arms_alert_past_value": "15.521240234375"
},
"endsAt": "2021-02-22T07:27:15.404000000Z",
"fingerprint": "bec72890cc2c7b4a027e008df0cd1013",
"labels": {
"container": "kube-state-metrics",
"severity": "warning",
"_aliyun_arms_alert_level": "ERROR",
"instance": "10.0.80.186:10255",
"clustername": "klyz1688-kubernetes-1",
"_aliyun_arms_alert_type": "101",
"_aliyun_arms_integration_name": "Test integration-prometheus",
"alertname": "Container memory usage > 80%",
"_aliyun_arms_userid": "1131971649496228",
"_aliyun_arms_involvedObject_name": "klyz1688-kubernetes-1",
"pod_name": "kube-state-metrics-ccb59dbff-jljg4",
"_aliyun_arms_involvedObject_id": "cb36dcafb9b9340498fad2e1f40b9a254",
"_aliyun_arms_region_id": "cn-hangzhou",
"_aliyun_arms_involvedObject_kind": "cluster",
"_aliyun_arms_product_type": "PROMETHEUS",
"name": "k8s_kube-state-metrics_kube-state-metrics-ccb59dbff-jljg4_arms-prom_359508f3-7e76-4740-b915-41ea48849641_0",
"namespace": "arms-prom",
"_aliyun_arms_integration_id": "80",
"_aliyun_arms_involvedObject_type": "ManagedKubernetes",
"_aliyun_arms_alert_rule_id": "3927051"
},
"startsAt": "2021-02-22T07:18:15.578000000Z",
"status": "firing"
}
],
"commonAnnotations": {
"_aliyun_arms_alert_value": "15.521240234375",
"_aliyun_arms_alert_message": "null\n Message ID: ac10c42a16124966960554200d2450-7996494\n",
"_aliyun_arms_alert_now_value": "15.521240234375",
"message": "Alert: Namespace: {{$labels.namespace}} / Pod: {{$labels.pod_name}} / Container: {{$labels.container}} Memory usage > 80%, Current value {{ printf \"%.2f\" $value }}%",
"value": "15.521240234375",
"_aliyun_arms_alert_past_value": "15.521240234375"
},
"commonLabels": {
"container": "kube-state-metrics",
"severity": "warning",
"_aliyun_arms_alert_level": "ERROR",
"instance": "10.0.80.186:10255",
"clustername": "klyz1688-kubernetes-1",
"_aliyun_arms_alert_type": "101",
"_aliyun_arms_integration_name": "Test integration-prometheus",
"alertname": "Container memory usage > 80%",
"_aliyun_arms_userid": "1131971649496228",
"_aliyun_arms_involvedObject_name": "klyz1688-kubernetes-1",
"pod_name": "kube-state-metrics-ccb59dbff-jljg4",
"_aliyun_arms_involvedObject_id": "cb36dcafb9b9340498fad2e1f40b9a254",
"_aliyun_arms_region_id": "cn-hangzhou",
"_aliyun_arms_involvedObject_kind": "cluster",
"_aliyun_arms_product_type": "PROMETHEUS",
"name": "k8s_kube-state-metrics_kube-state-metrics-ccb59dbff-jljg4_arms-prom_359508f3-7e76-4740-b915-41ea48849641_0",
"namespace": "arms-prom",
"_aliyun_arms_integration_id": "80",
"_aliyun_arms_involvedObject_type": "ManagedKubernetes",
"_aliyun_arms_alert_rule_id": "3927051"
},
"externalURL": "https://alerts.console.aliyun.com/#/alarm/alert/detail/2848",
"groupLabels": {
"alertname": "Container memory usage > 80%"
},
"receiver": "testjiubian",
"status": "firing"
}Obtain the open-source Alertmanager format in a webhook
- Log on to the ARMS console. In the left-side navigation pane, choose .
On the page that appears, click the Webhook Integration tab, and click Create Webhook.
In the dialog box that appears, set the parameters shown in the following figure. For more information, see Step 2: Create a webhook for a contact.
