Volcengine Managed Service for Prometheus
Variable | Type | Sample Value | Description |
Variable | Type | Sample Value | Description |
Region | String | cn-beijing | The region where the alert was triggered. Valid values:
tip |
AlertingRuleName | String | The CPU utilization is greater than 80% | The name of the alerting rule. |
AlertingRuleDescription | String | Alert description | The description of the alerting rule. |
AlertingRuleDetailURL | String | https://console.volcanicengine.com/prometheus/***3503d49e/detail | The URL of the alerting rule. This URL can redirect you to the corresponding alerting rule. |
Level | String | P0 | The alert level. Valid values: P0, P1, and P2. |
PromQL | String | rate(cpu_total[1m]) | The PromQL statement that is used to trigger the alert in the alerting rule. |
Comparator | String | > | The alert comparison condition. Valid values:
|
Threshold | String | 0.8 | The threshold of the alert. |
For | String | 3m | The duration of the alert. |
Alerts | - | The details of the alert resource, which is displayed in a nested structure. |
Variable | Type | Sample Value | Description |
Variable | Type | Sample Value | Description |
Id | String | cdwaihonj434390ad | The alert ID. |
Labels | map[string]string | "cluster": "ccmp26s0bjh01jhk860f0", "namespace": "default", "service": "nginx", "pod": "nginx-85996***""" | The details of the failed resource in the alert. |
Value | Float64 | 0.84 | The alert value. tip This parameter only applies to the alerting notification templates and does not apply to the alerting restoration notification template. |
StartsAt | time.Time | 2024-02-02 17:13:32.065 +0800 CST | The start time of the alert. |
EndsAt | time.Time | 2024-02-02 17:13:32.065 +0800 CST | The end time of the alert. tip This parameter applies to the alerting restoration notification templates and does not apply to the alerting notification template. |
DetailURL | String | https://console.volcanicengine.com/prometheus/***/alert/alerting?detail_id=*** | The URL of the alert in the console. This URL can redirect you to the corresponding alert. |
Function | Description | |
Function | Description | |
vkeClusterName | Obtains a cluster name based on the clusterID of a Volcengine Kubernetes Engine (VKE) cluster. | The VKE metrics written through the collection add-on in a VKE cluster will contain the cluster label, whose value is the cluster ID. You can also use the extension function to obtain a cluster name in an alerting notification. You can perform the following configuration to obtain the cluster name:
{{ range $i, $alert := .Alerts -}} {{ if lt $i 5 -}} No. {{ add1 $i }} resource{{ if $alert.Annotations }}: Cluster name: {{ $alert.Labels.cluster | vkeClusterName }} {{- range $key, $value := $alert.Labels }} {{ $key }}: {{ $value }} {{- end }} Current value: {{ $alert.Value }} Alert ID: {{ $alert.Id }} Alert start time: {{ date "2006-01-02T15:04:05Z07:00" $alert.StartsAt }} --- {{ else if eq $i 5 -}} The details of only top 5 failed resources are displayed. Click [alert content details]({{ $.AlertListConsoleURL }}) to view more details. {{- end }} {{- end }} |
arkEndpointName | Obtains an endpoint name based on endpointID. | The metrics written by ModelArk are all added with the ark_endpoint label, whose value is an endpoint ID. You can also use the extension function to obtain an endpoint name in an alerting notification. You can perform the following configuration to obtain the endpoint name:
{{ range $i, $alert := .Alerts -}} {{ if lt $i 5 -}} No. {{ add1 $i }} resource{{ if $alert.Annotations }}: Endpoint name: {{ $alert.Labels.ark_endpoint | arkEndpointName }} {{- range $key, $value := $alert.Labels }} {{ $key }}: {{ $value }} {{- end }} Current value: {{ $alert.Value }} Alert ID: {{ $alert.Id }} Alert start time: {{ date "2006-01-02T15:04:05Z07:00" $alert.StartsAt }} --- {{ else if eq $i 5 -}} The details of only top 5 failed resources are displayed. Click [alert content details]({{ $.AlertListConsoleURL }}) to view more details. {{- end }} {{- end }} |