CloudMonitor lets you set alert rules on system events and custom events for ApsaraDB for MongoDB. When an exception occurs, you receive a notification immediately and can start troubleshooting without delay.
This topic describes how to create a system event-triggered alert rule and a custom event-triggered alert rule.
Prerequisites
Before you begin, ensure that you have:
An application group with MongoDB instances added, if you plan to scope alerts to a specific group. See Create an application group and Modify an application group
Event types
CloudMonitor supports two event types:
| Event type | Description | Supported services |
|---|---|---|
| System event | Platform-managed events generated by Alibaba Cloud services, such as instance failures or configuration changes. | See Supported Alibaba Cloud services and system events. |
| Custom event | Application-level anomalies that you report to CloudMonitor via API. | All services supported by CloudMonitor. |
Create a system event-triggered alert rule
Log on to the CloudMonitor console.
In the left-side navigation pane, click Application Groups.
On the Application Groups tab, click the name of the application group you want.
In the left-side navigation pane, click System Event.
On the Event Monitoring page, click Save as Alert Rule.
In the Create/Modify Event-triggered Alert Rule panel, configure the following parameters.
Basic info
Parameter Description Alert Rule Name A name for the alert rule. Event-triggered alert rules
Parameter Description Product Type The Alibaba Cloud service to monitor. For supported services, see Appendix 2: System events. Event Type The category of event that triggers the alert. For supported event types per service, see Appendix 2: System events. Event Level The severity level that triggers the alert. For supported levels per service, see Appendix 2: System events. Event Name The specific event name that triggers the alert. For supported event names per service, see Appendix 2: System events. Keyword Filtering Filter alerts by keywords in the event content. Valid values: Contains any of the keywords (alert fires when the event content includes any specified keyword) and Does not contain any of the keywords (alert fires when none of the specified keywords are present). To view the event content structure, see View system events. SQL Filter A SQL expression to filter event content using andandoroperators. For example,Warn and i-hp368focau7dp0hw****triggers alerts only when the event content contains both the instance IDi-hp368focau7dp0hw****and the severity levelWarn.Resource Range The scope of resources the rule monitors. All Resources applies the rule to all resources of the selected service. Application Group applies it only to resources in a specific application group, which you select from a dropdown. Notification method (select at least one)
Option Description Alert Notification Sends notifications to a contact group. Configure the Contact Group and the Notification Method (Critical, Warning, or Info, each delivered via Email + Webhook). Message Service - Queue Delivers alerts to a Message Service (MNS) queue for programmatic processing. Function Compute Triggers a Function Compute (FC) function when an alert fires. URL Callback Sends an HTTP POST request to a public URL. Only HTTP URLs are supported. To verify connectivity, click Test next to the URL, configure the Test Template Type and Language in the Webhook Test panel, click Test, then click Close. For setup details, see Configure callbacks for system event-triggered alerts. Log Service Delivers alerts to a Simple Log Service (SLS) Logstore. Mute For
The interval at which CloudMonitor resends notifications while an alert remains unresolved. Valid values: 5 Minutes, 15 Minutes, 30 Minutes, 60 Minutes, 3 Hours, 6 Hours, 12 Hours, and 24 Hours.
During the mute period, CloudMonitor suppresses repeated notifications even if the condition persists. Once the mute period ends and the alert is still active, CloudMonitor sends another notification. For example, if Mute For is set to 12 Hours, you receive a follow-up notification every 12 hours until the alert clears.
Click OK.
Create a custom event-triggered alert rule
Log on to the CloudMonitor console.
In the left-side navigation pane, click Application Groups.
On the Application Groups tab, click the name of the application group you want.
In the left-side navigation pane, click Custom Event.
On the Custom Event page, click the Event-triggered Alert Rules tab.
Click Create Alert Rule.
In the Create/Modify Event-triggered Alert Rule panel, configure the following parameters.
Parameter Description Alert Rule Name A name for the alert rule. Event Name The name of the custom event to monitor. Rule Description The alert condition: the number of times the event must occur within a given period before an alert fires. The period can be 1, 2, 3, 4, or 5 minutes. Notification Methods The severity level and delivery method for alert notifications. Valid values: Email + Webhook(CRITICAL), Email + Webhook(WARN), and Email + Webhook(INFO). Contact Group The alert contact group that receives the notifications. Alert Callback A public callback URL and request method. CloudMonitor sends a POST or GET request to the URL. Only HTTP URLs are supported. To verify connectivity, click Test next to the URL, configure the Test Template Type and Language in the Webhook Test panel, click Test, then click Close. Click OK.