You can manage general alert rules in OceanBase Cloud Platform (OCP).
Create an alert rule
OCP provides a series of built-in alert rules. You can view and edit the built-in alert rules. For more information, see OCP Alert Reference of the corresponding version. You can also create custom alert items as needed.
Log on to the OCP console.
In the left-side navigation pane, choose System Management > Alerts.
On the Alert Rules tab, click Create Alert Rule.
Specify the basic information of the alert rule.
Specify the 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 OBServer nodes.Use
host_as the prefix for alerts related to OCP servers.Use
ocp_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 the description of the alert rule.
Briefly describe the purpose of the alert rule.
Specify the 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 objects.
Set the operation 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. Notes:
- 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.
- Multiple metrics: Multiple metrics are suitable for complex alert scenarios. You can configure multi-level
ANDorORmetric relationships for an alert rule.
Specify Alert Cycle.
The alert cycle is a detection cycle, in 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 be reported again.
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.
Create a rule group
OCP provides six default rule groups: dba, dev, oms, backup, info, and ocp. You can edit the default groups but cannot delete them. You can create a new rule group.
Log on to the OCP console.
In the left-side navigation pane, choose System Management > Alerts.
Manage rule groups in the left-side navigation pane of the Alert Rules tab.
Click the Create icon on the right of Rule Group list, enter the name of the new group, and press Enter.
Add an alert rule to a rule group
To facilitate alert pushing, you can log on to OCP and add an alert rule to a rule group as needed.
In the left-side navigation pane, choose System Management > Alerts.
On the Alert Rules tab, find the target alert rule.
In the Actions column of the alert rule, click the More icon (...) and select Add to Rule Group.
In the dialog box that appears, select a rule group.
Click OK.