All Products
Search
Document Center

ApsaraDB for MongoDB:Subscribe to event notifications

Last Updated:Nov 14, 2024

You can configure alert rules for the system events of ApsaraDB for MongoDB instances in the CloudMonitor module integrated in the ApsaraDB for MongoDB console. After you configure alert rules, alerts are generated when the specified thresholds are reached or the specified events are triggered. This helps you make business decisions in a timely manner.

Background information

CloudMonitor is the service to monitor Internet applications and Alibaba Cloud resources. You can configure CloudMonitor to notify you of system exceptions. Then, you can automate the event handling process based on alert notifications. CloudMonitor supports the following notification methods:

  • Send alert notifications to you by using emails, text messages, or DingTalk chatbots.

  • Push events to Simple Message Queue (SMQ), Function Compute, Log Service, or a specified callback URL. This allows you to automate the event handling process.

Procedure

  1. Create an alert contact or alert contact group. For more information, see Create an alert contact or alert contact group.

  2. Log on to the ApsaraDB for MongoDB console.

  3. In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances.

  4. In the upper-left corner of the page, select the resource group and region to which the instance belongs.

  5. Click the ID of the instance that you want to manage or click Manage in the Actions column.

  6. Set an event-triggered alert.

    1. In the left-side navigation pane, click Alert Rules.

    2. Click Set Alert Rule. You are redirected to the Set Alert Rule.

    3. On the Alert Rules page in the CloudMonitor console, click Create Alert Rule.

    4. In the Create Alert Rule panel, configure the parameters described in the following table.

      Parameter

      Description

      Product

      You do not need to change this parameter value. By default, the current instance is selected.

      Resource Range

      The range of the resources to which the alert rule is applied. Default value: Instances.

      Associated Resources

      You do not need to change this parameter value. By default, the ID of the current instance is selected.

      Rule Description

      The content of the alert rule. If a metric meets a specific condition, an alert is triggered. To specify the condition, perform the following steps:

      1. Click Add Rule and select a metric type from the drop-down list.

      2. In the Configure Rule Description panel, enter a rule name in the Alert Rule field and configure the Metric Type parameter. Valid values of the Metric Type parameter:

        • Single Metric: Select a metric and set the threshold and alert level for the metric.

        • Combined Metrics: Select an alert level and specify alert conditions for two or more metrics in the Multi-metric Alert Condition section.

        • Dynamic Threshold: For more information about dynamic thresholds, see Overview and Create dynamic threshold-triggered alert rules.

          Note

          The dynamic threshold feature is in invitational preview. To use the feature, you must submit a ticket.

      3. Click OK.

      Note

      For information about how to specify complex alert conditions, see Alert rule expressions.

      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 a metric value reaches the threshold, CloudMonitor sends an alert notification. If the metric value reaches the threshold again within the mute period, CloudMonitor does not resend an alert notification. If the alert is not cleared after the mute period ends, CloudMonitor resends an alert notification.

      For example, if the Mute For parameter is set to 12 Hours and the alert is not cleared, CloudMonitor resends an alert notification after 12 hours.

      Effective Period

      The period during which the alert rule is effective. CloudMonitor sends alert notifications based on the alert rule only within the effective period.

      Note

      If an alert rule is not effective, no alert notification is sent. However, the alert history is still displayed on the Alert History page.

      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 specified 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 name and a tag value.

      Note

      You can set a maximum of six tags.

      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 alert callback, see Use the alert callback feature to send notifications about threshold-triggered alerts.

      To test the connectivity of an alert callback URL, perform the following steps:

      1. Click Test next to the alert 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.

        Note

        To obtain the details of the test result, configure the Test Template Type and Language parameters and click Test.

      2. Click Close.

      Note

      You can click Advanced Settings to configure this parameter.

      Auto Scaling

      If you turn on Auto Scaling, the specified scaling rule is enabled when an alert is triggered based on the alert rule. In this case, configure the following parameters: Region, ESS Group, and ESS Rule.

      Note

      You can click Advanced Settings to configure this parameter.

      Log Service

      If you turn on Log Service, the alert information is sent to the specified Logstore when an alert is triggered based on the alert rule. 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.

      Note

      You can click Advanced Settings to configure this parameter.

      Message Service - topic

      If you turn on Message Service - topic, the alert information is sent to the specified topic in SMQ 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.

      Note

      You can click Advanced Settings to configure 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.

      Note

      You can click Advanced Settings to configure 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

      Note

      You can click Advanced Settings to specify this parameter.

    5. Click Confirm.

Related API operations

Operation

Description

PutEventRule

Creates or modifies an event-triggered alert rule.