You can use CloudMonitor to configure only threshold-triggered alert rules based on specific metrics. If you need to configure an alert rule that is triggered based on the computing results of multiple metrics, you can use Hybrid Cloud Monitoring.
Prerequisites
A File Storage NAS (NAS) file system is created. For more information, see Create a file system.
One or more alert contact groups are created. For more information, see Create an alert contact or alert contact group.
Hybrid Cloud Monitoring is activated. For more information, see Activate Hybrid Cloud Monitoring.
A namespace is created. For more information, see Create a namespace.
Procedure
Import NAS metrics.
Log on to the CloudMonitor console.
In the left-side navigation pane, choose
.On the Namespace page, find the namespace that you want to configure. Then, click an icon (indicating the number of accounts, number of cloud services, number of metrics, or number of tasks that you want to add to the namespace) in the Metric Data column.
On the Alibaba Cloud Service Metrics tab of the Metric management panel, add NAS metrics.
Add the NAS service.
Click the icon next to Current Account.
In the Add Product dialog box, select Apsara File Storage NAS and click OK.
Add NAS metrics.
Click Apsara File Storage NAS and then click Add metric.
In the Add metric dialog box, select the metrics that you want to add and click OK.
NoteBoth NAS metrics and Cloud Parallel File Storage (CPFS) metrics can be monitored in the CloudMonitor console. CPFS metrics are available in the Add metric dialog box. You must select the metrics whose Metric Category is NAS. For more information about NAS metrics, see Metrics.
Create an alert rule.
On the Namespace page, click Create Alert Rule.
In the Create Alert Rule panel, configure the parameters. The following table describes the parameters.
Parameter
Description
Rule Name
The name of the alert rule.
Namespace
Select the namespace that is specified in Step 1.
Alert Expression
The condition that triggers alerts. If a metric meets the specified condition, an alert is triggered.
Tag
The tags of the alert rule. You can set the key and value of each tag.
Annotations
The annotations of the alert rule. You can set the key and value of each annotation.
Mute For
The interval at which CloudMonitor resends alert notifications before an alert is cleared. Valid values: 5 Minutes, 15 Minutes, 30 Minutes, 60 Minutes, 3 Hours, 6 Hours, 12 Hours, and 24 Hours.
If the value of a metric reaches the alert threshold, CloudMonitor sends alert notifications.
If the alert is triggered again within the mute period, CloudMonitor does not resend alert notifications.
If the alert is not cleared after the mute period ends, CloudMonitor resends alert notifications.
For example, if Mute For is set to 12 Hours and the alert is not cleared, CloudMonitor resends an alert notification 12 hours later.
Effective Period
The period during which the alert rule is effective. CloudMonitor monitors the specified resources based on the alert rule only within the specified period.
Alert Contact Group
The alert contact groups to which alert notifications are sent.
The alert notifications of the application group are sent to the alert contacts that belong to the selected alert contact groups. An alert contact group can contain one or more alert contacts.
For information about how to create an alert contact and an alert contact group, see Create an alert contact or alert contact group.
Notification Methods
The alert level and the methods that are used to send alert notifications. Valid values:
Info (Email + Webhook)
You can specify the consecutive periods of time during which the metric value exceeds the threshold before an alert is triggered. Valid values of the consecutive cycles: 1, 3, 5, 10, 15, 30, 60, 70, 90, 120, and 180. One consecutive cycle is equal to 1 minute.
Alert Callback
The callback URL that can be accessed over the Internet. CloudMonitor sends HTTP POST requests to push alert notifications to the specified URL. You can enter only an HTTP URL.
To test the connectivity of an alert callback URL, perform the following steps:
Click Test next to the callback URL.
In the Webhook Test panel, you can check and troubleshoot the connectivity of the alert callback URL based on the returned status code and test result details.
NoteTo obtain the details of the test result, configure the Test Template Type and Language parameters and click Test.
Click Close.
Auto Scaling
If you turn on Auto Scaling, the specified scaling rule is enabled when an alert is triggered. In this case, you must configure the Region, ESS Group, and ESS Rule parameters.
For information about how to create a scaling group, see Manage scaling groups.
For information about how to create a scaling rule, see Manage scaling rules.
Log Service
If you turn on Log Service, the alert information is written to the specified Logstore in Simple Log Service when an alert is triggered. In this case, you must configure the Region, ProjectName, and Logstore parameters.
For information about how to create a project and a Logstore, see Getting Started.
Message Service - topic
If you turn on Message Service - topic, the alert information is written to the specified topic in Message Service when an alert is triggered. In this case, you must configure the Region and topicName parameters.
For information about how to create a topic, see Create a topic.
Function Compute
If you turn on Function Compute, an alert notification is sent to Function Compute for format processing when an alert is triggered. In this case, you must configure the Region, Service, and Function parameters.
For information about how to create a service and a function, see Quickly create a function.
Method to handle alerts when no monitoring data is found
The method that is used to handle alerts when no monitoring data is found. Valid values:
Do not do anything (default)
Send alert notifications
Treated as normal
Click OK.
Optional. View the created alert rule.
In the left-side navigation pane, choose
.On the Alert Rules page, the alert rule whose Product Name is Prometheus is the one that you created.
References
For more information about how to modify an alert rule, see Manage alert rules.
For more information about how to manage namespaces, see Manage namespaces.