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 OceanBase Cloud Platform (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.
Click the Alert Rules tab.
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 the following rules for naming alerts:
Use
ob_cluster_as the prefix for alerts related to OceanBase clusters.Use
ob_tenant_as the prefix for alerts related to OceanBase Database tenants.Use
ob_host_as the prefix for alerts related to OBServers.Use
host_as the prefix for alerts related to OCP servers.Use
ob_service_as the prefix for alerts related to OCP services.Use
obproxy_cluster_as the prefix for alerts related to OBProxy clusters.Use
obproxy_host_as the prefix for alerts related to OBProxy servers.
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 fields in the Rule Configuration section for the alert rule.
Specify Alert Object.
Alert Object Description Application The alert source. Options include 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. Alert Object 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.
Configuration of operation rules:
Single metric
A single operation rule is configured for alert reporting. You can configure at most five rules because the threshold and level in a rule cannot overlap with those in another rule.
Field 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.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.
Field 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.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_cpuexceeds 2%.

Specify Alert Cycle.
Alert Cycle specifies the detection cycle at which the system detects whether the trigger condition is met. In the following example, the default detection cycle of 60 seconds is used:
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 continues to detect whether the trigger condition is met once every alert cycle. If yes, the alert will not be eliminated.
Specify Time Before Clearance.
This parameter specifies the retention duration of an alert after the alert is reported. The system automatically clears the alert after the specified duration expires. The default 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.