The cloud-native gateways of Microservices Engine (MSE) provide the alerting feature based on Application Real-Time Monitoring Service (ARMS). If alert rules are matched, MSE sends alert notifications to you by using emails, text messages, or DingTalk messages in real time. This helps you identify errors at the earliest opportunity. On the Alerts page, you can manage custom alert rules of your account and query the history of alert events and alert notifications.
Prerequisites
A contact group is created. For more information, see Create a contact group.
Background information
An alert control is used to display data in datasets. When you create an alert control, a dataset is also created to store the underlying data of the alert control.
New alert rules take effect within 10 minutes. If an alert rule is matched, MSE reports an alert with a delay of 1 to 3 minutes.
Create an alert rule
Log on to the MSE console. In the top navigation bar, select a region.
In the left-side navigation pane, choose Cloud-native Gateway > Alerts > Alert Policies.
On the Cloud-native Gateway Alerts page, click Create Cloud-native Gateway Alert Policies.
On the Create Cloud-native Gateway Alert Policies page, configure the parameters and click Complete. The following table describes the parameters.
Parameter
Description
Alert Rule Name
The name of the alert rule.
Gateway
The gateway that you want to manage.
Alert Contact Group
The alert group.
Alert Metric
Select an alert metric based on your business requirements. Different alert groups support different alert metrics.
Alert Condition
The condition of the alert rule. For example, if the number of requests that the gateway receives per second decreases by 20% compared with the previous day, MSE sends alert notifications.
Filter Conditions
Default value: No Filter. The default value indicates that no filter conditions are required.
Duration
Specify the time when the alert event is generated.
Alert Level
The severity of the alert. Valid values: Default, P4, P3, P2, and P1. The values are listed in ascending order by severity.
Alert Message
The alert content that you want to display when an alert is triggered. You can configure alert variables for the Alert Message parameter by using the Go template syntax. Example:
ID of the instance on which alerting is enabled: {{$label.envoy_clusterid}} Alert threshold: {{$labels.metrics_params_value}} Actual value for alert triggering: {{ printf "%.2f" $value }}
The alert information varies based on alert metrics.
Alert Notification
Select Simple Mode or Standard Mode.
Specify Notification Policy
If Standard Mode is selected for Alert Notification, the alert center of ARMS dispatches and processes alert events and sends alert notifications based on the notification policy that you configured.
Advanced Settings
Click the icon. You can configure parameters such as Tags and Annotations.
Alert Check Cycle
The interval between which alert rule-based checks are performed.
Tags
Click Create Tag to create a tag for the alert rule. The tag is used as an option for the dispatching rule.
Annotations
Click Create Annotation. Set Key to message and set Value to a value in the format of {{Variable name}}Alert information. The annotation that you created is in the
message:{{$labels.pod_name}}Restart}}Alert information
format. Example:message:{{$labels.pod_name}}Restart
.
What to do next
On the Cloud-native Gateway Alerts page, find the alert rule that you want to manage and click an option in the Actions column to perform one of the following operations on the alert rule:
To modify the alert rule, click Edit in the Actions column. On the Edit Cloud-native Gateway Alert Policies page, modify the alert rule and click Save.
To enable or disable the alert rule, click Start or Stop in the Actions column. In the message that appears, click OK.
To delete the alert rule, click Delete in the Actions column. In the message that appears, click OK.
To view the alert history, click Alert Event History in the Actions column. On the Events page, you can view the alert history.
Optional. To manage multiple alert rules at a time, select the rules and perform the following operations based on your business requirements.
To enable multiple alert rules at a time, click Batch Operations in the lower-left corner of the page and click Enable Alert Rules. In the message that appears, click OK.
To disable multiple alert rules at a time, click Batch Operations in the lower-left corner of the page and click Disable Alert Rules. In the message that appears, click OK.
To delete multiple alert rules at a time, click Batch Operations in the lower-left corner of the page, and click Delete Alert Rules. In the message that appears, click OK.
To configure multiple tags at a time, click Batch Operations in the lower-left corner of the page, and click Configure Tags. In the message that appears, click OK.