ApsaraDB for MongoDB allows you to configure threshold-triggered alert rules that are 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 threshold-triggered alert rules for an ApsaraDB for MongoDB instance in the ApsaraDB for MongoDB console.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the upper-left corner of the page, select the resource group and the region of the target instance.
  3. In the left-side navigation pane, click Replica Set Instances, or Sharded Cluster Instances based on the instance type.
  4. Find the target instance and click its ID.
  5. In the left-side navigation pane, click Alert Rules.
  6. In the upper-left corner of the page that appears, click Set Alert Rule.
    You are directed to the CloudMonitor console.
  7. In the CloudMonitor console, configure a threshold-triggered alert rule for the ApsaraDB for MongoDB instance.
    1. Click the Threshold Value Alert tab.
    2. In the upper-left corner of the tab, click Create Alert Rule.
    3. On the Create Alert Rule page, configure the following parameters:
      1. Related Resource sectionConfigure the parameters in the Related Resource section.
        Parameter Description
        Product The Alibaba Cloud service to which you want to apply the alert rule. Select ApsaraDB for MongoDB-Single Node Instance, ApsaraDB for MongoDB-Instance Copy, or ApsaraDB for MongoDB-Cluster Instance.
        Resource Range The resources to which you want to apply the alert rule. Valid values:
        • All Resources: The alert rule is applied to all instances of the specified Alibaba Cloud service that are created within your Alibaba Cloud account.

          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.

        • Instances: The alert rule is applied only to the instances that you specify.

          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%.

        Region Select the region to which the ApsaraDB for MongoDB instance belongs.
        Note This parameter appears only when you set the Resource Range parameter to Instances.
        Instances The ID of the ApsaraDB for MongoDB instance. You can specify more than one ApsaraDB for MongoDB instance.
        Note This parameter appears only when you set the Resource Range parameter to Instances.
        Mongos The ID of the mongos node to which you want to apply the alert rule.
        Note This parameter appears only when you set the Product parameter to ApsaraDB for MongoDB-Cluster Instance and set the Resource Range parameter to Instances.
        Shard The ID of the shard node to which you want to apply the alert rule.
        Note This parameter appears only when you set the Product parameter to ApsaraDB for MongoDB-Cluster Instance and set the Resource Range parameter to Instances.
      2. Set Alert Rules sectionConfigure the parameters in the Set Alert Rules section.
        Note You can click Add Alert Rule to configure multiple alert rules. The metrics for which you can configure alert rules vary based on the architecture of the ApsaraDB MongoDB instance. For more information, see the following topics:
        Parameter Description
        Alert Rule The name of the alert rule.
        Rule Description The content of the alert rule. This parameter specifies the conditions based on which an alert is triggered.

        For example, you can configure an alert rule based on which an alert is triggered when the average CPU utilization over a 5-minute period is greater than or equal to 90% for three consecutive periods. In this case, CloudMonitor checks whether the average CPU utilization is greater than or equal to 90% every 5 minutes for three consecutive periods.

        role The role of the ApsaraDB for MongoDB instance. Valid values: Anyrole, Primary, Secondary, Readonly, and Hidden.
        Note
        • If the ApsaraDB for MongoDB instance is a standalone instance, you do not need to specify this parameter.
        • If the ApsaraDB for MongoDB instance is a replica set instance or a sharded cluster instance and you set the Resource Range parameter to All Resources, you must set the role parameter to Anyrole.
        Mute for The interval at which CloudMonitor resends alert notifications. After an alert is triggered, CloudMonitor resends alert notifications at the specified interval before the alert is cleared.
        Effective Period The period of time during which the alert rule is effective. CloudMonitor monitors the metric and generates alerts only when the alert rule is in effect.
      3. Notification Method sectionConfigure the parameters in the Notification Method section.
        Parameter Description
        Notification Contact The contact groups to which alert notifications are sent. You can click Quickly create a contact group to create a contact group. For more information, see Create an alert group
        Notification Methods

        The methods that are used to send alert notifications. Valid value: Email + DingTalk (Info).

        Auto Scaling If you select Auto Scaling, a specific scaling rule is triggered when an alert is generated. You must configure the Region, ESS Group, and ESS Rule parameters.
        Log Service If you select Log Service, the alert information is written to Log Service when an alert is generated. You must configure the Region, Project, and Logstore parameters.

        For more information about how to create a project and a Logstore, see Quick start.

        Email Remark The additional information that you want to include in each alert notification that is sent over email.
        HTTP CallBack The URL that can be accessed over the Internet. CloudMonitor uses the HTTP POST method to send alert notifications to this URL.
  8. Click Confirm.
  9. Return to the Threshold Value Alert tab and view the alert rule. You can also view the alert rule on the Alert Rules page in the ApsaraDB for MongoDB console.

References