OceanBase Cloud Platform (OCP) allows you to perform alert management. To be specific, you can manage alert events and block alerts.
Alert event management: When an exception occurs in a cluster, you may receive a large number of alert notifications. In this case, if you want to view specific alert notifications and perform statistical analysis on specific alert notifications, you can manage alert events as needed.
Alert blocking: A bug that causes exception alerts may require a long time to be fixed. To prevent frequent interruptions by these alerts, you can go to the Alert Blocking tab to block these alerts for a specific period of time.
View alert events
Log on to the OCP console.
In the left-side navigation pane, choose System Management > Alerts.
Click the Alert Events tab.
Specify search criteria in the search area. All alert events that match the search criteria will be displayed in the Alert Events list.
You can search for alert events by alert status, alert level, start time, end time, keyword, application, and alert scope. Exact match is supported.
You can click Export Alert Event to export all alert events that match the search criteria to your computer.
If alert pushes are configured for the alert event, you can click Failed in the Message Push column to view details about the alert event.
If alert push is not configured for the alert event, you can click Message Push Not Configured in the Message Push column to configure alert push for the alert event.
Click the description in the Alert Description column of an alert event. The Details page of the alert event appears.
You can view the information and notification history related to the alert on the Details page.
On the details page of the alert event, click Alert Blocking in the upper-right corner to block alert messages.
Then, the alert will not be reported before the block period expires.
When many alert events are received, you can clear alert messages as needed.
In the left-side navigation pane, choose System Management > Parameter Management.
Search for the
ocp.alarm.notification.expired-daysparameter in the parameter list to set the retention period of alert messages, in days.After you specify this parameter, the alert messages and alert events that exceed the retention period will be deleted. The following data will be deleted upon expiration:
ocp2_alarm_notification
ocp_alarm_event_notification
ocp2_alarm_event_history
ocp_alarm_event_record
ocp2_alarm_filter (Cleared data will be written to the
ocp2_alarm_filter_historytable. The amount of rule information is small and therefore the rule history table does not need to be cleared.)
Notice
- We recommend that you set the alert clearing period to a proper value, for example, several months.
- Alerts must not be left uncleared and unhandled for a long time. You can configure alert message push. We recommend that you promptly handle received alert messages.
Alert blocking
You can quickly block alerts on the Alert Events tab. However, this method blocks only reported alerts for a specified period of time, which is not flexible.
This section describes how to create a blocking condition. It is a more flexible method that allows you to block alerts before they are generated. After a blocking condition is created, the system starts to block alerts based on the condition. If the blocking condition does not take effect immediately, wait for another 30 seconds.
When you run an O&M task on an OceanBase cluster, alerts are automatically blocked.
Log on to the OCP console.
In the left-side navigation pane, choose System Management > Alerts.
On the Alert Blocking tab, click Create Blocking Condition.
Configure the blocking condition in the Create Blocking Condition dialog box.
Field Description Application The alert source. Options include OceanBase, OBProxy, OCP, OMS, and Logs. Masked Object Types The blocking scope. Valid values: All, Tenant, and Server. The options vary with the setting of Application. Blocking Object The alert objects that use the alert rule. You can select specific alert objects as needed.
If you select All, you can select Excluded Objects on the right to exclude objects that do not need to be blocked.Mask Alert Rules Select one or more alert items to be blocked. Label Specify one or more tags to block alerts for specific metrics, for example, slow SQL alerts. You can filter SQL statements by their IDs. You can add up to eight tags. Blocking End Time Specify the end time for the blocking condition. The blocked alerts will not be reported before the end time expires. - Click the End Time field to select the end time.
- You can also click a time next to the End Time field. For example, if you click 6 Hours, the system enters the time six hours later from the current time to the End Time field.
Daily Block Period You can toggle on the Daily Block Period switch, and specify the start time and end time. The system blocks alerts during the specified period every day. If you want to block a specific alert, you can add a tag to exactly match the alert. The following example shows how to block a slow SQL alert for the meta2 tenant in the adminMT cluster.
- (Optional) Add a tag named ob_cluster and set the tag value to the cluster name, which is adminMT.
- (Optional) Add a tag named ob_cluster_id and set the tag value to the cluster ID, which is 15. The cluster ID is used to distinguish between primary and standby clusters.
- (Optional) Add a tag named tenant_name and set the tag value to the tenant name, which is meta2.
- Add a tag named sql_id and set the tag value to the ID of the slow SQL statement.
Note
The system blocks an alert only when the alert matches all the tags. The optional configurations are intended to help you better understand and use tags. You can ignore these configurations in practice.
Click OK.
The system returns to the Blocking Conditions list, which contains the newly created condition.
By default, all alert blocking conditions are displayed in the Blocking Conditions list.
Note
- After an alert blocking condition is created, it takes effect within 30s.
- Alert blocking conditions that have been expired for more than 7 days are not displayed in the Blocking Conditions list.