ApsaraDB for MongoDB allows you to configure a threshold-triggered alert rule that is used to monitor the crucial metrics of an ApsaraDB for MongoDB instance. If the value of a metric is not within the range that you specify in the alert rule for the metric, CloudMonitor sends you an alert notification about the exception. The information in the alert notification helps you efficiently handle the exception. This topic describes how to configure a threshold-triggered alert rule for an ApsaraDB for MongoDB instance in the ApsaraDB for MongoDB console.
Procedure
Log on to the ApsaraDB for MongoDB console.
In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances.
In the upper-left corner of the page, select the resource group and region to which the instance belongs.
Click the ID of the instance that you want to manage, or find the instance and click Manage in the Actions column.
In the left-side navigation pane, click Alert Rules.
Click Set Alert Rule in the upper-left corner to go to the CloudMonitor console.
In the CloudMonitor console, configure a threshold-triggered alert rule for the instance.
In the left-side navigation pane, choose Alerts > Alert Rules. On the Alert Rules page, click Create Alert Rule.
In the Create Alert Rule panel, configure the parameters described in the following table.
Parameter
Description
Product
The name of the Alibaba Cloud service that can be monitored by CloudMonitor.
Select ApsaraDB for MongoDB - Standalone Instance, ApsaraDB for MongoDB-Instance Copy, or ApsaraDB for MongoDB-Cluster Instance.
Resource Range
The range of the resources on which you want the alert rule to take effect. Valid values:
All Resources: The alert rule applies to all resources of the specified cloud service.
For example, you can configure an alert rule based on which an alert is triggered when CPU utilization exceeds 80% and apply the alert rule to all ApsaraDB for MongoDB instances that are created within your Alibaba Cloud account. In this case, CloudMonitor sends you an alert notification when the CPU utilization of an ApsaraDB for MongoDB instance exceeds 80%. If you set the Resource Range parameter to All Resources, the alert rule can be applied to up to 1,000 instances. If more than 1,000 instances of the specified Alibaba Cloud service are created within your Alibaba Cloud account, CloudMonitor may not send you alert notifications even if the value of the metric in the alert rule reaches the specified threshold. Before you configure the alert rule, we recommend that you group the instances based on your business requirements.
Application Groups: The alert rule applies to all resources in the specified application group of the specified cloud service.
Instances: The alert rule applies to the specified resources.
For example, you can configure an alert rule based on which an alert is triggered when CPU utilization exceeds 80% and apply the alert rule to an Elastic Compute Service (ECS) instance. In this case, CloudMonitor sends you an alert notification when the CPU utilization of the ECS instance exceeds 80%.
Rule Description
The content of the alert rule. If a metric meets a specific condition, an alert is triggered. To specify conditions, perform the following steps:
Click Add Rule and then select Simple Metric, Combined Metrics, Expression, or Dynamic Threshold from the drop-down list.
In the Configure Rule Description panel, specify a rule name, metric type, metric, threshold, and alert level.
Click OK.
NoteYou can click Add Rule to configure multiple alert rules. The metrics for which you can configure alert rules vary based on the architecture of the ApsaraDB for MongoDB instance. For more information, see the following topics:
Mute For
The interval at which you want CloudMonitor to resend alert notifications if the alert is not cleared. Valid values: 5 Minutes, 15 Minutes, 30 Minutes, 60 Minutes, 3hour, 6hour, 12hour, and 24hour.
If the threshold value is exceeded, CloudMonitor sends an alert notification. If the threshold value is exceeded again within the mute period, CloudMonitor does not resend an alert notification. If the alert is not cleared when the mute period elapses, CloudMonitor resends an alert notification.
Effective Period
The period of time during which you want the alert rule to take effect. CloudMonitor monitors the specified resources based on the alert rule only within the specified period of time.
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. A contact group can contain one or more contacts.
For more information about how to create an alert contact and an alert contact group, see Create an alert contact or alert contact group.
Tag
The tag of the alert rule. A tag consists of a tag key and a tag value.
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. Only HTTP requests are supported. For more information about how to configure an alert callback, see Use the alert callback feature to send notifications about threshold-triggered alerts.
NoteYou can click Advanced Settings to configure this parameter.
Auto Scaling(The corresponding scaling rule will be triggered when the alert occurs.)
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 more information about how to create a scaling group, see Manage scaling groups.
For more information about how to create a scaling rule, see Manage scaling rules.
NoteYou can click Advanced Settings to specify this parameter.
Log Service
If you turn on Log Service and an alert is triggered, the alert information is written to the specified Logstore in Log Service. 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.
NoteYou can click Advanced Settings to specify this parameter.
Message Service - topic
If Message Service - Topic is turn on, the alert information is written to the specified topic in Simple Message Queue (formerly MNS) 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.
NoteYou can click Advanced Settings to specify this parameter.
Function Compute
If you turn on Function Compute, an alert notification is sent to Function Compute for format processing when an alert is triggered based on the alert rule. In this case, you must configure the Region, Service, and Function parameters.
For more information about how to create a service and a function, see Quickly create a function.
NoteYou can click Advanced Settings to specify this parameter.
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
NoteYou can click Advanced Settings to specify this parameter.
Click Confirm.
After the configuration is completed, return to the alert rule list and view the alert rule. You can also view the alert rule on the Alert Rules page in the ApsaraDB for MongoDB console.
References
You can also create threshold-triggered or event-triggered alert rules in the CloudMonitor console. For more information, see Create an alert rule and Manage system event-triggered alert rules (old).
You can manage the created alert rule in the CloudMonitor console. For more information, see the following topics: