All Products
Search
Document Center

API Gateway:Create alert rules

Last Updated:Mar 21, 2025

If you want to monitor the usage of various resources, you can create alert rules. If resource metrics meet specific alert conditions, alerts are triggered and the CloudMonitor system sends alert notifications. This way, you can identify and handle exceptions at the earliest opportunity.

Procedure

  1. Log on to the Cloud-native API Gateway console.

  2. In the left-side navigation pane, click Alert. Then, click Create Alert Rule.

  3. In the Create Alert Rule panel, set the parameters. The following table describes the parameters:

    Parameter

    Description

    Resource Range

    The range of the resources to which the alert rule applies. Valid values:

    • All Resources: The alert rule applies to all resources of the specified cloud service.

    • Instances: The alert rule applies to the specified resources of the specified cloud service.

    Rule Description

    The condition that triggers the alert rule. An alert is triggered when the specified condition is met. To specify a condition, perform the following operations:

    1. Click Add Rule and then select Simple Metric, Combined Metrics, Expression, or Dynamic Threshold from the drop-down list.

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

      • Simple Metric: Select a metric and specify a threshold and an alert level for the metric.

      • Combined Metrics: Select an alert level and specify alert conditions for two or more metrics.

      • Expression: Select an alert level and then configure an alert expression.

      • 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, submit a ticket.

    3. Click OK.

    Note

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

    Mute For

    The interval at which you want CloudMonitor to send alert notifications again if the alert is not cleared. Valid values: 5 min, 15 min, 30 min, 60 min, 3 h, 6 h, 12 h, and 24 h.

    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 Mute For 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.

    Tag

    The tag that you want to attach to the alert rule. A tag consists of a tag key and a tag value.

    Note

    You can configure a maximum of six tags.

    Alert Contact Group

    The alert group to which alert notifications are sent.

    The alert notifications of the application group are sent to the contacts that belong to the specified contact group. An alert group includes one or more alert 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.

    Advanced Settings

    Alert Callback

    The callback URL that can be accessed over the Internet. CloudMonitor sends a POST request to push an alert to the specified callback URL. Only HTTP callbacks are supported. For information about how to configure an 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 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. In the message that appears, click Close.

    Note

    The parameter is in the Advanced Settings section.

    Push Channel

    If you turn on Push Channel, raw alert data or combined denoised data is pushed to a specific Alibaba Cloud service. The following services are supported as a push destination:

    • Auto Scaling: Alerts trigger the corresponding scaling rule. If you select this option, you must further configure Region, ESS Group, and ESS Rule. For more information, see Configure scaling groups and Configure scaling rules.

    • Log Service: Alert data is pushed to a specified Logstore in Simple Log Service . If you select this option, you must further configure Region, ProjectName, and Logstore. For more information, see Getting Started.

    • Simple Message Queue: Alert data is pushed to a specified topic or queue in Simple Message Queue. If you select this option, you must further configure Region and topicName. For more information, see Get started with topic-based messaging.

    • Function Compute: Alert data is pushed to a specified function. If you select this option, you must further configure Region, Service, and Function. For more information, 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

    Note

    The parameter is in the Push Channel subsection of the Advanced Settings section.

  4. Click Confirm.