You can use the custom monitoring feature to create custom metrics and configure alert rules for the metrics. You can call the PutCustomMetric operation to report business metrics about which you are concerned to CloudMonitor. Then, you can view monitoring data and configure alert rules for these metrics in the CloudMonitor console. CloudMonitor sends alert notifications about abnormal metrics to you. This allows you to handle failures at the earliest opportunity and ensures business continuity.

Prerequisites

Monitoring data is reported. For more information, see Overview.

Background information

The following differences exist between event monitoring and custom monitoring:
  • The event monitoring feature is used to report, query, and trigger alerts for non-sequential data.
  • The custom monitoring feature is used to report, query, and trigger alerts for time series data that is continuously collected on a regular basis.

View the monitoring data of custom metrics

  1. Log on to the CloudMonitor console.
  2. In the left-side navigation pane, click Custom Monitoring.
  3. On the Time Series tab of the Custom Monitoring page, select the application group and time series. Then, click Dimensions.
  4. In the Dimensions panel, select the dimension that you want to use and click OK.
    By default, CloudMonitor queries the monitoring data for the latest one hour. You can select a time period based on your needs.

Create an alert rule for custom monitoring

  1. Log on to the CloudMonitor console.
  2. In the left-side navigation pane, click Custom Monitoring.
  3. On the Event Monitoring page, click the Alert Rules tab.
  4. Click Create Alert Rule.
  5. In the Create/Modify Custom Monitoring Alert Rule panel, configure the parameters for the alert rule. The following table describes the parameters.
    Parameter Description
    Rule Name The name of the alert rule.
    Application Group The ID of the application group to which the alert rule belongs.

    By default, the Application Group parameter is set to Does not belong to any group. You can select an application group based on your business requirements. For more information, see Create an application group.

    Metric The name of the custom metric.
    Dimension The resources for which you want to query the monitoring data.

    Format: a set of key-value pairs. Examples: instanceId:i-uf6j91r34rnwawoo**** and userId:100931896542****.

    Notification Method

    The notification method. In this example, the Email + DingTalk option is specified.

    Rule Description The condition that triggers the alert rule. If the metric meets the specified condition, the alert rule is triggered.
    Contact Group A group of alert contacts that receive alert notifications. For more information, see Create an alert contact or alert contact group.
    • If the Application Group parameter is set to Does not belong to any group, you can select a contact group. If the alert rule is triggered, the alert contacts in the contact group receive alert notifications.
    • If you select an application group from the Application Group drop-down list, you can select a contact group. If the alert rule is triggered, the alert contacts in the contact group receive alert notifications. The contact group of the application group remains unchanged. The alert contacts in the contact group do not receive alert notifications.
    Triggered when threshold is exceeded for The number of consecutive times the threshold value is exceeded. If the number of times exceeds the limit that you specify, the alert contacts in the contact group receive alert notifications. Valid values: 1, 3, 5, 10, 15, and 30.
    Mute For The interval at which CloudMonitor sends alert notifications until the alert that is triggered based on the alert rule is cleared. Valid values: 5miniute, 10minute, 15minute, 30minute, 60minute, 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 Time 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 Callback The callback URL that can be accessed over the Internet. CloudMonitor sends a POST or GET request to push an alert to the callback URL that you specify. Only HTTP requests are supported. For more information about how to set callback URLs, see Use the alert callback feature to send notifications about threshold-triggered alerts.
  6. Click Confirm.