OceanBase Cloud Platform (OCP) provides built-in alert rules to meet the monitoring requirements of your business. You can also customize alert rules by referring to this topic. Compared with creating an alert template, creating an alert rule allows you to more flexibly specify alert objects for each rule.
For more information about the built-in alert rules, see Alert Reference.
Prerequisites
The logged-on user in the OCP console is granted the ADMIN or ALARM_MANAGER role.
Procedure
Log on to the OCP console.
In the left-side navigation pane, click Alert Center.
On the Alert Rules tab, click Create Alert Rule.
Specify the fields in the Basic Information section of the alert rule.
Specify Alert Rule Name.
Third-party applications identify and connect to alert rules in OCP through their names specified by Alert Rule Name. An alert rule name can contain only letters, digits, and underscores (_). We recommend that you observe the following rules when you name alerts:
Prefix names of alerts related to OceanBase clusters with
ob_cluster_.Prefix names of alerts related to OceanBase Database tenants with
ob_tenant_.Prefix names of alerts related to OBServer nodes with
ob_host_.Prefix names of alerts related to OCP servers with
host_.Prefix names of alerts related to OCP services with
ob_service_.Prefix names of alerts related to OBProxy clusters with
obproxy_cluster_.Prefix names of alerts related to OBProxy servers with
obproxy_host_.
Specify Description.
Briefly describe the purpose of the alert rule.
Specify Rule Group.
Add the alert rule to an existing rule group.
Specify whether to Enable Alerting.
You can disable system built-in alert rules and custom alert rules that are temporarily not used.

Specify the parameters in the Rule Configuration section for the alert rule.
Specify Alert Object.
Alert object Configuration description Application The alert source. Valid values: OceanBase, OBProxy, OCP, OMS, and Logs. Alert Object Type The object type of the alert rule. You can select an object type as needed. The options vary with the setting of Application. Cluster The alert objects that use the alert rule. You can select specific alert objects as needed. If you select All, existing objects and objects added in the future that are of the current alert object type will be included. You can select Excluded Objects on the right to exclude objects that do not need to use the alert rule. 
Specify Alert Rule.
You can configure different operation rules based on your business requirements. The system reports alerts of different levels based on the configured operation rules.
You can choose to configure alert rules based on a single metric or multiple metrics.
Single metric
A single operation rule is configured for alert reporting. The threshold and level in a rule cannot overlap with those in another rule. You can configure at most five rules.
Parameter Description Metric Select a metric from the Metric drop-down list. For more information about metrics, see the corresponding topics in Alert Reference.
You can click Add Metric in the Metric drop-down list to add a custom alert metric. For more information, see Optional monitoring metrics for custom alerts.Duration Specify the alert duration. The value 0 indicates that an alert is immediately triggered if the specified operation rule is met. Alert Level Specify the alert level. 
Multiple metrics
Multiple metrics are suitable for complex alert scenarios. You can configure multi-level AND or OR metric relationships for an alert rule.
Parameter Description Metric relationship Select an operation mode for multiple metrics. Options include AND and OR. AND indicates that all conditions must be met. OR indicates that any one of the conditions is met. Metric Select a metric from the Metric drop-down list. For more information about metrics, see the corresponding topics in Alert Reference.
You can click Add Metric in the Metric drop-down list to add a custom alert metric. For more information, see Optional monitoring metrics for custom alerts.Add Rule Add one or more rules for the metric. The system performs an operation on the rules based on the selected metric relationship. Add Rule Group Add a rule group and configure a metric relationship for multiple metrics in the rule group. A rule group is a collection of operations for multiple metrics. Duration Specify the alert duration. The value 0 indicates that an alert is immediately triggered if the specified operation rule is met. Alert Level Specify the alert level. In the following figure, multiple metrics are configured. A critical alert is triggered when the resource metrics of a server meet one of the following conditions for 2 minutes:
- The memory usage exceeds 95%.
- The Network Time Protocol (NTP) clock offset exceeds 100 ms.
- The CPU utilization exceeds 95%, and the average value of load1_per_cpu exceeds 2%.

Specify Alert Cycle.
Set the alert detection cycle, clearance cycle, and whether to automatically clear the alert.
Detection Cycle: the detection cycle for alert metrics. The system checks in each detection cycle whether the alert trigger condition is met. By default, the detection cycle is 60 seconds.
The system detects whether the trigger condition is met once every 60 seconds. If yes, the alert is reported.
After the alert is reported, the system still checks in each detection cycle whether the trigger condition is met, and reports an alert if yes.
Automatic Clearance: specifies whether to automatically clear the alert. If automatic clearance is disabled, the alert message will be retained in the alert event list. You can confirm the impact scope of the alert and choose whether to manually clear the alert. If automatic clearance is enabled, the system automatically clears the alert based on the clearance cycle.
Time Before Clearance: the duration of a reported alert. The system automatically clears the alert after the specified duration expires. The default clearance cycle is 5 minutes.

Specify alert details.
You can reference variables by using
${}. The alert details template is displayed in the alert event and corresponds to the ${alarm_description} variable. This variable can be referenced in the alert message template.
Click Submit.