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 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 the Create a contact group section in the "Manage alert contacts" topic.
Background information
An alert control is a method 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 alerts take effect within 10 minutes. A delay of 1 to 3 minutes may exist when MSE checks alerts.
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 > Policies.
In the upper-right corner of the Cloud-native Gateway Alert Policy Management page, click Create Cloud-native Gateway Alerts.
On the Create Cloud-native Gateway Alerts page, configure the parameters and click Save. The following table describes the parameters.
Parameter
Description
Alert Rule Name
Enter a name for the alert rule.
Gateway
Select the gateway that you want to manage.
Alert Contact Group
Select Gateway Alert Group. This parameter specifies the group of the alert metrics.
Alert Metric
Select an alert metric based on your business requirements. Different alert groups support different alert metrics.
Alert Conditions
Specify 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
Select the severity of the alert. The default alert severity is Default. The alert severity increases in the following order: Default, P4, P3, P2, and P1.
Alert Message
Enter 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 the alert metrics.
Advanced Settings
Click the icon. You can configure the parameters such as Tags and Annotations.
Alert Check Cycle
Specify the interval between which alert rule-based checks are performed.
Alert Notification
Select Minimalist mode or Normal mode.
Specify Notification Policy
If Normal 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.
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 Alert Policy Management 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 Alert page, modify the alert rule and click Save.
To enable or disable the alert rule, click Enable or Disable in the Actions column. In the message that appears, click OK.
To delete the alert rule, click Delete in the Actions column. In the Tips message, click OK.
To view the alert history, click Alert 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 one of the following operations:
To enable multiple alert rules at a time, click Enable Alert Rules. In the message that appears, click OK.
To disable multiple alert rules at a time, click Disable Alert Rules. In the message that appears, click OK.
To delete multiple alert rules at a time, click Delete Alert Rules. In the message that appears, click OK.