Application Real-Time Monitoring Service (ARMS) allows you to configure alert notification templates for webhooks. ARMS sends webhook alert notifications in the open-source Alertmanager format. This page describes the JSON payload structure, field definitions, and how to enable the Alertmanager format in a webhook.
Limitations
Content-Typemust beapplication/json.The
$contentfield and the$alertmanager_contentfield are mutually exclusive. If both are present, only$alertmanager_contenttakes effect.The ARMS console webhook test does not replace the
$alertmanager_contentfield with actual values.
For setup instructions, see Use a webhook to send custom alert notifications.
Payload structure
The following schema shows the JSON structure of a webhook notification.
{
"status": "<string>", // Overall alert status: "firing" or "resolved"
"receiver": "<string>", // Name of the notification receiver
"externalURL": "<string>", // Link to the alert detail page in the ARMS console
"groupLabels": { // Labels used to group alerts
"<labelName>": "<labelValue>"
},
"commonLabels": { ... }, // Labels shared by all alerts in this group
"commonAnnotations": { ... }, // Annotations shared by all alerts in this group
"alerts": [ // Array of individual alert objects
{
"status": "<string>", // Alert status: "firing" or "resolved"
"startsAt": "<rfc3339>", // Time the alert started firing
"endsAt": "<rfc3339>", // Time the alert resolved (0001-01-01T00:00:00Z if unresolved)
"fingerprint": "<string>", // Hash that uniquely identifies this alert by its labels
"labels": { // Key-value pairs that identify the alert
"<labelName>": "<labelValue>"
},
"annotations": { // Key-value pairs with additional alert metadata
"<annotationName>": "<annotationValue>"
}
}
]
}Top-level fields
| Field | Type | Description |
|---|---|---|
status | string | Overall status of the alert group. Valid values: firing, resolved. |
receiver | string | Name of the notification receiver. |
externalURL | string | URL to the alert detail page in the ARMS console. |
groupLabels | object | Labels used to group alerts. Map of string keys to string values. |
commonLabels | object | Labels shared by all alerts in the group. Map of string keys to string values. |
commonAnnotations | object | Annotations shared by all alerts in the group. Map of string keys to string values. |
alerts | array | Individual alert objects. See the following table for the alert object schema. |
Alert object fields
| Field | Type | Description |
|---|---|---|
status | string | Status of this alert. Valid values: firing, resolved. |
startsAt | string | RFC 3339 timestamp when the alert started firing. |
endsAt | string | RFC 3339 timestamp when the alert resolved. Set to 0001-01-01T00:00:00Z if unresolved. |
fingerprint | string | Hash that uniquely identifies this alert based on its label set. |
labels | object | Key-value pairs that identify the alert, including standard and ARMS-specific labels. |
annotations | object | Key-value pairs with additional alert metadata, including standard and ARMS-specific annotations. |
ARMS-specific labels
In addition to standard Alertmanager labels such as alertname, severity, and namespace, ARMS adds the following labels prefixed with _aliyun_arms_:
| Label | Description | Example |
|---|---|---|
_aliyun_arms_alert_level | ARMS alert level. | ERROR |
_aliyun_arms_alert_type | Alert type code. | 101 |
_aliyun_arms_alert_rule_id | ID of the alert rule that triggered this alert. | 3927051 |
_aliyun_arms_userid | Alibaba Cloud user ID. | 1131971649496228 |
_aliyun_arms_region_id | Region where the alert originated. | cn-hangzhou |
_aliyun_arms_product_type | ARMS product type. | PROMETHEUS |
_aliyun_arms_integration_name | Name of the integration that generated the alert. | Test integration-prometheus |
_aliyun_arms_integration_id | ID of the integration. | 80 |
_aliyun_arms_involvedObject_name | Name of the related resource. | klyz1688-kubernetes-1 |
_aliyun_arms_involvedObject_id | ID of the related resource. | cb36dcafb9b9340498fad2e1f40b9a254 |
_aliyun_arms_involvedObject_kind | Kind of the related resource. | cluster |
_aliyun_arms_involvedObject_type | Type of the related resource. | ManagedKubernetes |
ARMS-specific annotations
| Annotation | Description | Example |
|---|---|---|
_aliyun_arms_alert_value | Metric value that triggered the alert. | 15.521240234375 |
_aliyun_arms_alert_now_value | Current metric value at alert time. | 15.521240234375 |
_aliyun_arms_alert_past_value | Previous metric value for comparison. | 15.521240234375 |
_aliyun_arms_alert_message | Alert message content. | null\n Message ID: ac10c42a16124966960554200d2450-7996494\n |
Example payload
The following example shows a complete webhook notification for a container memory usage alert:
{
"status": "firing",
"receiver": "testjiubian",
"externalURL": "https://alerts.console.aliyun.com/#/alarm/alert/detail/2848",
"groupLabels": {
"alertname": "Container memory usage > 80%"
},
"commonLabels": {
"alertname": "Container memory usage > 80%",
"container": "kube-state-metrics",
"severity": "warning",
"instance": "10.0.80.186:10255",
"clustername": "klyz1688-kubernetes-1",
"pod_name": "kube-state-metrics-ccb59dbff-jljg4",
"namespace": "arms-prom",
"name": "k8s_kube-state-metrics_kube-state-metrics-ccb59dbff-jljg4_arms-prom_359508f3-7e76-4740-b915-41ea48849641_0",
"_aliyun_arms_alert_level": "ERROR",
"_aliyun_arms_alert_type": "101",
"_aliyun_arms_alert_rule_id": "3927051",
"_aliyun_arms_userid": "1131971649496228",
"_aliyun_arms_region_id": "cn-hangzhou",
"_aliyun_arms_product_type": "PROMETHEUS",
"_aliyun_arms_integration_name": "Test integration-prometheus",
"_aliyun_arms_integration_id": "80",
"_aliyun_arms_involvedObject_name": "klyz1688-kubernetes-1",
"_aliyun_arms_involvedObject_id": "cb36dcafb9b9340498fad2e1f40b9a254",
"_aliyun_arms_involvedObject_kind": "cluster",
"_aliyun_arms_involvedObject_type": "ManagedKubernetes"
},
"commonAnnotations": {
"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_value": "15.521240234375",
"_aliyun_arms_alert_now_value": "15.521240234375",
"_aliyun_arms_alert_past_value": "15.521240234375",
"_aliyun_arms_alert_message": "null\n Message ID: ac10c42a16124966960554200d2450-7996494\n"
},
"alerts": [
{
"status": "firing",
"startsAt": "2021-02-22T07:18:15.578000000Z",
"endsAt": "2021-02-22T07:27:15.404000000Z",
"fingerprint": "bec72890cc2c7b4a027e008df0cd1013",
"labels": {
"alertname": "Container memory usage > 80%",
"container": "kube-state-metrics",
"severity": "warning",
"instance": "10.0.80.186:10255",
"clustername": "klyz1688-kubernetes-1",
"pod_name": "kube-state-metrics-ccb59dbff-jljg4",
"namespace": "arms-prom",
"name": "k8s_kube-state-metrics_kube-state-metrics-ccb59dbff-jljg4_arms-prom_359508f3-7e76-4740-b915-41ea48849641_0",
"_aliyun_arms_alert_level": "ERROR",
"_aliyun_arms_alert_type": "101",
"_aliyun_arms_alert_rule_id": "3927051",
"_aliyun_arms_userid": "1131971649496228",
"_aliyun_arms_region_id": "cn-hangzhou",
"_aliyun_arms_product_type": "PROMETHEUS",
"_aliyun_arms_integration_name": "Test integration-prometheus",
"_aliyun_arms_integration_id": "80",
"_aliyun_arms_involvedObject_name": "klyz1688-kubernetes-1",
"_aliyun_arms_involvedObject_id": "cb36dcafb9b9340498fad2e1f40b9a254",
"_aliyun_arms_involvedObject_kind": "cluster",
"_aliyun_arms_involvedObject_type": "ManagedKubernetes"
},
"annotations": {
"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_value": "15.521240234375",
"_aliyun_arms_alert_now_value": "15.521240234375",
"_aliyun_arms_alert_past_value": "15.521240234375",
"_aliyun_arms_alert_message": "null\n Message ID: ac10c42a16124966960554200d2450-7996494\n"
}
}
]
}Set up Alertmanager format in a webhook
Log on to the ARMS console.
In the left-side navigation pane, choose Alert Management > Notification Objects.
Click the Webhook Integration tab, then click Create Webhook.
Configure the webhook parameters. For details, see Create a webhook for a contact.
