Overview
This API is used to query the alert history.
API details
Constraints
The caller must pass the authentication for OCP application services.
Request path
GET /api/v2/alarm/alarms/history
Request parameters
body:
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| appType | String | No | OceanBase | Application category (alert source). Valid values:
|
| scope | String | No | Cluster | Alert scope. Valid values:
|
| target | Array | No | alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 | The target object of the alert, generated based on the target template in the alert rule. |
| alarmType | String | No | ob_tenant_exists_expired_xa_trans | Alert type. |
| level | Array | No | 1 | Alert levels [1~5], corresponding to: Down, Critical, Alert, Caution, and Info. |
| alarmGroupIds | integer | No | [1,2,3] | List of alert group IDs, separated by commas. |
| status | Array | No | Active | Alert status. Valid values:
|
| activeAtStart | String | No | 2020-11-11T11:12:13.127+08:00 | The time when the alert was triggered. |
| activeAtEnd | String | No | 2020-11-11T17:11:13.127+08:00 | The deadline for triggering the alert. |
| keyword | String | No | hello | Keyword match. |
Response parameters
Basic data structures
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The requested data. |
| ├─ contents | Array | Alert details. For more information, see OcpAlarm data structure. |
| ├─ page | Object | Pagination information. For details, see page data structure. |
| successful | Boolean | Whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An HTTP status code. |
| traceId | String | The trace ID of the request, used for troubleshooting. |
| server | String | The address of the application service that responded to the request. |
OcpAlarm data structure
Parameter |
Type |
Description |
|---|---|---|
| gmtCreate | String | Creation time. |
| gmtModified | String | Modified at. |
| id | Integer | Alert event ID. |
| alarmId | Integer | Alert ID. |
| alarmTemplateId | Integer | Alert template ID. |
| appType | String | Application type. Valid values:
|
| alarmType | String | Alert type. |
| scope | String | Alert scope. Valid values:
|
| level | Integer | The alert severity levels [1~5] correspond to Down, Critical, Alert, Caution, and Info, respectively. |
| status | String | Alert status. Valid values:
|
| target | String | The target object of the alert, generated based on the target template in the alert rule. |
| alarmTarget | Object | Information about the alert target. For more information, see AlertTarget data structure. |
| obCluster | Object | For more information, see AlarmTarget data structure. |
| name | String | Alert name. |
| summary | String | Alert overview, generated based on the overview template of the alert rule. |
| description | String | Alert details, generated based on the details template of the alert rule. |
| activeAt | String | The time when the alert was generated. |
| resolvedAt | String | Alert clearance time. |
| updatedAt | String | The time when the alert was updated. |
| statusUpdatedAt | String | The time when the alert status was updated. |
| labels | Object | The tag and value of the alert event. |
| targetLabels | Object | The tag and value of the alert object, for example,svr_ip、ob_tenant_idand so on. |
| metricGroup | Object | Array of metric groups. For more information, see MetricGroup data structure. |
| messagePush | Object | Alert push details. For more information, see MessagePush data structure. |
| alarmGroups | Array | The list of alert groups. |
| originalAlarmId | Integer | The plaintiff's ID. |
| containSnapshot | Boolean | Whether to include abnormal snapshots. |
| containSelfcure | Boolean | Whether to include self-healing. |
| resolveComment | String | Additional information about how to resolve the alert. |
AlarmTarget data structure
Parameter |
Type |
Description |
|---|---|---|
| appType | String | Application type. Valid values:
|
| scope | String | Alert scope. Valid values:
|
| includeTargets | Array | Alert target (positive selection). |
| excludeTargets | Array | Exclude Alert Targets (Inverse Selection). |
MetricGroup data structure
Parameter |
Type |
Description |
|---|---|---|
| id | Integer | The ID of the metric group. |
| key | String | The encoded name of the metric group. |
| className | String | The class name corresponding to the metric group. |
| name | String | The name of the metric group, which supports internationalization. |
| description | String | The description of the metric group, which supports internationalization. |
| metrics | Array | An array of metric metadata. |
| dimension | String | The dimension for grouping metrics. |
| withLabel | Boolean | Whether it is a labeled monitoring data group. Default value:false. |
| order | Integer | Sort parameter. |
MessagePush data structure
Parameter |
Type |
Description |
|---|---|---|
| configured | Boolean | Whether to enable alert push. |
| successCount | Integer | Number of successfully pushed messages. |
| noSuccessCount | Integer | The number of failed message pushes. |
Page data structure
Parameter |
Type |
Description |
|---|---|---|
| totalElements | Integer | Total Records. |
| totalPage | Integer | Total number of pages. |
| number | Integer | Current page number. |
| size | Integer | Number of records on the current page. |
Examples
Request example
GET /api/v2/alarm/alarms/history
Response example
{
"data": {
"contents": [{
"activeAt": "2025-06-06T05:36:51Z",
"alarmGroups": ["Database Kernel"],
"alarmId": 186,
"alarmTarget": {
"appType": "OceanBase",
"excludeTargets": [],
"includeTargets": [{
"cluster": {
"clusterId": 4,
"name": "ob3245_ps",
"obClusterId": 1731295860
},
"hosts": [{
"hostId": 5,
"hostIp": "xxx.xxx.xxx.xxx",
"id": 5
}]
}],
"scope": "Host"
},
"alarmTemplateId": 0,
"alarmType": "observer_process_stop",
"appType": "OceanBase",
"autoResolved": true,
"containSelfcure": false,
"description": "Cluster: ob3245_ps, Host: xxx.xxx.xxx.xxx, Alert: OBServer process stopped.",
"gmtCreate": "2025-06-06T05:36:51Z",
"gmtModified": "2025-06-06T05:41:54.686997Z",
"id": 186,
"labels": {
"app_type": "OceanBase",
"alarm_threshold": "0",
"svr_ip": "xxx.xxx.xxx.xxx",
"value_zh_tw": "20245 days 5 hours 35 minutes 40 seconds",
"alarm_status_native": "Active",
"ob_cluster_type_shown": "Primary",
"observer_boot_time_delta_seconds_value_zh_cn": "20245 days 5 hours 35 minutes 40 seconds",
"alarm_level": "2",
"obregion": "ob3245_ps",
"app_native": "OB",
"alarm_summary_zh_tw": "alarm_template_id=0:ob_cluster=ob3245_ps-1731295860:host=xxx.xxx.xxx.xxx OBServer process stopped",
"alarm_summary_en_us": "alarm_template_id=0:ob_cluster=ob3245_ps-1731295860:host=xxx.xxx.xxx.xxx OBServer process stopped",
"alarm_type": "observer_process_stop",
"alarm_status": "Active",
"alarm_group_zh_tw": "Database kernel",
"host": "xxx.xxx.xxx.xxx",
"alarm_scope": "Host",
"alarm_scope_native": "Host",
"ob_cluster": "ob3245_ps",
"alarm_description_zh_tw": "Cluster: ob3245_ps, Server: xxx.xxx.xxx.xxx, Alert: OBServer process stopped.",
"value_en_us": "20245 days 5 hours 35 mins 40 secs",
"observer_boot_time_delta_seconds_value_en_us": "20245 days 5 hours 35 mins 40 secs",
"app": "OB",
"__ob_cluster.id": "4",
"contain_selfcure": "0",
"observer_boot_time_delta_seconds_value_zh_tw": "20245 days 5 hours 35 minutes 40 seconds",
"level": "2",
"related_svr_ips": "xxx.xxx.xxx.xxx",
"alarm_name_en_us": "OBServer process stopped",
"message_type": "Alarm",
"alarm_status_zh_cn": "Alarming",
"alarm_scope_zh_tw": "Host",
"alarm_group_en_us": "dba",
"value_zh_cn": "20,245 days 5 hours 35 minutes 40 seconds",
"alarm_description_en_us": "OceanBase cluster: ob3245_ps, host: xxx.xxx.xxx.xxx, alert: OBServer process stopped.",
"__host.id": "5",
"alarm_scope_zh_cn": "Host",
"alarm_level_zh_cn": "Critical",
"ob_cluster_type": "PRIMARY",
"alarm_summary_zh_cn": "alarm_template_id=0:ob_cluster=ob3245_ps-1731295860:host=xxx.xxx.xxx.xxx OBServer process stopped",
"ob_cluster_type_zh_tw": "Primary",
"alarm_description": "Cluster: ob3245_ps, Host: xxx.xxx.xxx.xxx, Alert: OBServer process stopped.",
"ob_cluster_type_native": "PRIMARY",
"app_zh_tw": "OceanBase",
"metrics": "observer_boot_time_delta_seconds",
"ocp_ip": "xxx.xxx.xxx.xxx",
"value_shown": "20245 days 5 hours 35 minutes 40 seconds",
"alarm_name": "OBServer Process Stop",
"alarm_status_zh_tw": "Warning",
"vpc_name": "system-default",
"related_tenant_names": "sys,mysql,oracle",
"values": "1749188140",
"alarm_level_zh_tw": "Severe",
"alarm_level_native": "2",
"alarm_scope_en_us": "Host",
"app_zh_cn": "OceanBase",
"alarm_level_en_us": "Critical",
"ob_cluster_type_en_us": "Primary",
"auto_resolved": "1",
"alarm_summary": "alarm_template_id=0:ob_cluster=ob3245_ps-1731295860:host=xxx.xxx.xxx.xxx OBServer process stopped",
"alarm_active_at": "2025-06-06T13:36:51.231+08:00",
"alarm_target": "alarm_template_id=0:ob_cluster=ob3245_ps-1731295860:host=xxx.xxx.xxx.xxx",
"app_en_us": "OceanBase",
"value": "1749188140",
"alarm_name_zh_tw": "OBServer process stopped",
"ob_cluster_type_zh_cn": "Primary",
"observer_boot_time_delta_seconds_value": "1749188140",
"__ob_server.id": "5",
"host_ip": "xxx.xxx.xxx.xxx",
"related_ob_cluster_name": "ob3245_ps",
"ob_cluster_name": "ob3245_ps",
"alarm_name_zh_cn": "OBServer process stopped",
"alarm_status_en_us": "Active",
"observer_boot_time_delta_seconds_alarm_threshold": "0",
"alarm_template_id": "0",
"ob_cluster_id": "1731295860",
"related_ob_cluster_id": "1731295860",
"alarm_description_zh_cn": "Cluster: ob3245_ps, Host: xxx.xxx.xxx.xxx, Alert: OBServer process stopped.",
"obzone": "zone1",
"alarm_updated_at": "2025-06-06T13:36:51.231+08:00",
"host_name": "fsx-deploy-host2-0",
"alarm_group_zh_cn": "Database Kernel"
},
"level": 2,
"messagePush": {
"configured": true,
"noSuccessCount": 0,
"successCount": 3
},
"name": "OBServer process stopped",
"resolvedAt": "2025-06-06T05:41:54Z",
"scope": "Host",
"status": "Inactive",
"statusUpdatedAt": "2025-06-06T05:41:54Z",
"summary": "alarm_template_id=0:ob_cluster=ob3245_ps-1731295860:host=xxx.xxx.xxx.xxx OBServer process stopped",
"target": "alarm_template_id=0:ob_cluster=ob3245_ps-1731295860:host=xxx.xxx.xxx.xxx",
"updatedAt": "2025-06-06T05:36:51Z"
},
{
"activeAt": "2025-06-06T02:57:52Z",
"alarmGroups": ["Database Kernel", "Self-Healing"],
"alarmId": 177,
"alarmTarget": {
"appType": "OceanBase",
"excludeTargets": [],
"includeTargets": [{
"cluster": {
"clusterId": 7,
"name": "ob4352_X",
"obClusterId": 1731295861
},
"tenants": [{
"name": "META$1004",
"obTenantId": 1004,
"tenantId": 19
}]
],
"scope": "Tenant"
},
"alarmTemplateId": 0,
"alarmType": "ob_tenant_request_queue_over_threshold",
"appType": "OceanBase",
"autoResolved": true,
"containSelfcure": false,
"description": "Cluster: ob4352_X, Tenant: META$1004, Alert: OceanBase tenant request queue exceeds the threshold. Tenant request wait time: ${request_queue_time_value_zh_cn}, request queue length 0 exceeds -1.",
"gmtCreate": "2025-06-06T02:57:52Z",
"gmtModified": "2025-06-06T03:45:38.796021Z",
"id": 177,
"labels": {
"ob_tenant_id": "1003",
"ob_tenant_request_queue_size_value": "0",
"__ob_tenant.id": "19",
"app_type": "OceanBase",
"alarm_threshold": "-1",
"svr_ip": "xxx.xxx.xxx.xxx",
"value_zh_tw": "0",
"alarm_status_native": "Active",
"ob_cluster_type_shown": "Primary",
"alarm_level": "3",
"obregion": "ob4352_X",
"app_native": "OB",
"alarm_summary_zh_tw": "alarm_template_id=0:ob_cluster=ob4352_X-1731295861:tenant_name=META$1004:host=xxx.xxx.xxx.xxx OceanBase tenant request queue exceeds the threshold",
"alarm_summary_en_us": "alarm_template_id=0:ob_cluster=ob4352_X-1731295861:tenant_name=META$1004:host=xxx.xxx.xxx.xxx OceanBase tenant request queue over threshold",
"ob_tenant": "META$1004",
"ob_tenant_request_queue_size_alarm_threshold": "-1",
"alarm_type": "ob_tenant_request_queue_over_threshold",
"alarm_status": "Active",
"alarm_group_zh_tw": "Database kernel, self-healing",
"host": "xxx.xxx.xxx.xxx",
"alarm_scope": "Tenant",
"ob_cluster": "ob4352_X",
"alarm_description_zh_tw": "Cluster: ob4352_X, Tenant: META$1004, Warning: OceanBase tenant request queue exceeds the threshold. Tenant request wait time: ${request_queue_time_value_zh_tw}, request queue length 0 exceeds -1.",
"value_en_us": "0",
"is_meta_tenant": "1",
"app": "OB",
"__ob_cluster.id": "7",
"contain_selfcure": "0",
"tenant_name": "META$1004",
"alarm_duration": "2563",
"level": "3",
"related_svr_ips": "xxx.xxx.xxx.xxx",
"alarm_name_en_us": "OceanBase tenant request queue over threshold",
"message_type": "Alarm",
"alarm_status_zh_cn": "Alerting",
"alarm_group_en_us": "dba,selfcure",
"value_zh_cn": "0",
"ob_tenant_request_queue_size_value_zh_cn": "0",
"alarm_description_en_us": "OceanBase cluster: ob4352_X, tenant: META$1004, alert: OceanBase tenant request queue over threshold. The tenant request wait time is ${request_queue_time_value_en_us}, request queue size 0 is over -1.",
"alarm_level_zh_cn": "Warning",
"tenant_role_en_us": "Primary",
"ob_cluster_type": "PRIMARY",
"alarm_summary_zh_cn": "alarm_template_id=0:ob_cluster=ob4352_X-1731295861:tenant_name=META$1004:host=xxx.xxx.xxx.xxx OceanBase tenant request queue exceeds the limit",
"ob_cluster_type_zh_tw": "Primary",
"alarm_description": "Cluster: ob4352_X, Tenant: META$1004, Alert: OceanBase tenant request queue exceeds limit. Tenant request wait time: ${request_queue_time_value_zh_cn}, request queue length 0 exceeds -1.",
"ob_cluster_type_native": "PRIMARY",
"app_zh_tw": "OceanBase",
"metrics": "request_queue_time,ob_tenant_request_queue_size",
"ocp_ip": "xxx.xxx.xxx.xxx",
"value_shown": "0",
"tenant_id": "1003",
"alarm_name": "OceanBase Tenant Request Queue Exceeds Limit",
"alarm_status_zh_tw": "Warning",
"vpc_name": "system-default",
"related_tenant_names": "META$1004",
"values": "0",
"alarm_level_zh_tw": "Warning",
"tenant_role": "PRIMARY",
"alarm_level_native": "3",
"app_zh_cn": "OceanBase",
"alarm_level_en_us": "Alert",
"ob_cluster_type_en_us": "Primary",
"auto_resolved": "1",
"alarm_summary": "alarm_template_id=0:ob_cluster=ob4352_X-1731295861:tenant_name=META$1004:host=xxx.xxx.xxx.xxx OceanBase tenant request queue exceeds limit",
"ob_tenant_request_queue_size_value_zh_tw": "0",
"alarm_active_at": "2025-06-06T10:57:51.799+08:00",
"alarm_target": "alarm_template_id=0:ob_cluster=ob4352_X-1731295861:tenant_name=META$1004:host=xxx.xxx.xxx.xxx",
"tenant_role_zh_tw": "Primary",
"app_en_us": "OceanBase",
"value": "0",
"alarm_name_zh_tw": "Excessive Request Queue for OceanBase Tenant",
"ob_cluster_type_zh_cn": "Primary",
"host_ip": "xxx.xxx.xxx.xxx",
"related_ob_cluster_name": "ob4352_X",
"ob_cluster_name": "ob4352_X",
"alarm_name_zh_cn": "Excessive Request Queue Length of OceanBase Tenant",
"alarm_status_en_us": "Active",
"tenant_role_shown": "Primary",
"alarm_template_id": "0",
"ob_cluster_id": "1731295861",
"related_ob_cluster_id": "1731295861",
"tenant_role_zh_cn": "Primary",
"alarm_description_zh_cn": "Cluster: ob4352_X, Tenant: META$1004, Alert: OceanBase tenant request queue exceeds limit. Tenant request wait time: ${request_queue_time_value_zh_cn}, Request queue length 0 exceeds -1.",
"tenant_role_native": "PRIMARY",
"obzone": "zone1",
"alarm_updated_at": "2025-06-06T10:57:51.799+08:00",
"ob_tenant_request_queue_size_value_en_us": "0",
"host_name": "obrd.8c.vd4-s4a7-n9",
"alarm_group_zh_cn": "Database kernel, self-healing"
},
"level": 3,
"messagePush": {
"configured": true,
"noSuccessCount": 0,
"successCount": 6
},
"name": "Excessive OceanBase Tenant Request Queue",
"resolvedAt": "2025-06-06T03:45:38Z",
"scope": "Tenant",
"status": "Inactive",
"statusUpdatedAt": "2025-06-06T03:45:38Z",
"summary": "alarm_template_id=0:ob_cluster=ob4352_X-1731295861:tenant_name=META$1004:host=xxx.xxx.xxx.xxx OceanBase tenant request queue exceeds limit",
"target": "alarm_template_id=0:ob_cluster=ob4352_X-1731295861:tenant_name=META$1004:host=xxx.xxx.xxx.xxx",
"updatedAt": "2025-06-06T03:40:34Z"
}],
"page": {
"number": 1,
"size": 10,
"totalElements": 186,
"totalPages": 19
}
},
"duration": 317,
"server": "21dc8a9b83",
"status": 200,
"successful": true,
"timestamp": "2025-06-06T15:35:37.216+08:00",
"traceId": "b61f0b63906e7e71"
}
