Overview
You can call this API to query the history of alerts.
API details
Constraints
You must be authorized for the application service in OCP.
Request path
GET /api/v2/alarm/alarms/history
Request parameters
body:
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| appType | String | No | OceanBase | The application category (the alert source). Valid values:
|
| scope | String | No | Cluster | The alert scope. Valid values:
|
| target | Array | No | alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 | The alert target object, which is generated based on the target template in the alert rule. |
| alarmType | String | No | ob_tenant_exists_expired_xa_trans | The alert type. |
| level | Array | No | 1 | The alert level [1~5] , which corresponds to: Down, Critical, Alert, Caution, and Info. |
| alarmGroupIds | integer | No | [1,2,3] | The list of alert group IDs. Separate multiple IDs with commas. |
| status | Array | No | Active | The alert status. Valid values:
|
| activeAtStart | String | No | 2020-11-11T11:12:13.127+08:00 | The alert trigger start time. |
| activeAtEnd | String | No | 2020-11-11T17:11:13.127+08:00 | The alert trigger end time. |
| keyword | String | No | hello | The keyword for matching. |
Response parameters
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The returned data. |
| ├─ contents | Array | The details of the alarm, for more information, see OcpAlarm. |
| ├─ page | Object | The pagination information, for more information, see page. |
| successful | Boolean | Indicates 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 | The HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
OcpAlarm data structure
Parameter |
Type |
Description |
|---|---|---|
| gmtCreate | String | The time when the alarm was created. |
| gmtModified | String | The time when the alarm was last modified. |
| id | Integer | The ID of the alarm event. |
| alarmId | Integer | The ID of the alarm. |
| alarmTemplateId | Integer | The ID of the alarm template. |
| appType | String | The type of the application. Valid values:
|
| alarmType | String | The type of the alarm. |
| scope | String | The scope of the alarm. Valid values:
|
| level | Integer | The level of the alarm. Valid values: 1 to 5. 1 indicates Down, 2 indicates Critical, 3 indicates Alert, 4 indicates Caution, and 5 indicates Info. |
| status | String | The status of the alarm. Valid values:
|
| target | String | The target of the alarm, which is generated based on the target template of the alarm rule. |
| alarmTarget | Object | The information of the alarm target. For more information, see AlarmTarget. |
| obCluster | Object | The information about the cluster. For more information, see AlarmTarget. |
| name | String | The name of the alarm. |
| summary | String | The summary of the alarm, which is generated based on the summary template of the alarm rule. |
| description | String | The details of the alarm, which is generated based on the details template of the alarm rule. |
| activeAt | String | The time when the alarm was generated. |
| resolvedAt | String | The time when the alarm was resolved. |
| updatedAt | String | The time when the alarm was last updated. |
| statusUpdatedAt | String | The time when the status of the alarm was last updated. |
| labels | Object | The tags and values of the alarm event. |
| targetLabels | Object | The tags and values of the alarm target, such as svr_ip and ob_tenant_id. |
| metricGroup | Object | The array of metric groups. For more information, see MetricGroup. |
| messagePush | Object | The details of the alarm push. For more information, see MessagePush. |
| alarmGroups | Array | The list of alarm groups. |
| originalAlarmId | Integer | The ID of the original alarm. |
| containSnapshot | Boolean | Indicates whether an abnormal snapshot exists. |
| containSelfcure | Boolean | Indicates whether self-healing is enabled. |
| resolveComment | String | The remarks about the resolution of the alarm. |
AlarmTarget data structure
Parameter |
Type |
Description |
|---|---|---|
| appType | String | The type of the application. Valid values:
|
| scope | String | The scope of the alarm. Valid values:
|
| includeTargets | Array | The alarm targets to be included. |
| excludeTargets | Array | The alarm targets to be excluded. |
MetricGroup data structure
Parameter |
Type |
Description |
|---|---|---|
| id | Integer | The ID of the metric group. |
| key | String | The code 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 | The array of metric metadata. |
| dimension | String | The dimension of the metric group. |
| withLabel | Boolean | Specifies whether the metric group is a labeled metric group. Default value: false. |
| order | Integer | The sort parameter. |
MessagePush data structure
Parameter |
Type |
Description |
|---|---|---|
| configured | Boolean | Indicates whether to configure alert message push. |
| successCount | Integer | The number of times the message push succeeded. |
| noSuccessCount | Integer | The number of times the message push failed. |
page data structure
Parameter |
Type |
Description |
|---|---|---|
| totalElements | Integer | The total number of records. |
| totalPage | Integer | The total number of pages. |
| number | Integer | The current page number. |
| size | Integer | The 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 is 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 stops",
"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 Core",
"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: The OBServer process stops.",
"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 mins 40 sec",
"level": "2",
"related_svr_ips": "xxx.xxx.xxx.xxx",
"alarm_name_en_us": "OBServer process stopped",
"message_type": "Alarm",
"alarm_status_zh_cn": "Alarms issued",
"alarm_scope_zh_tw": "主機",
"alarm_group_en_us": "dba",
"value_zh_cn": "20245 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 The OBServer process is stopped for ob3245_ps-1731295860.",
"ob_cluster_type_zh_tw": "Primary",
"alarm_description": "Cluster: ob3245_ps, Host: xxx.xxx.xxx.xxx, Alert: OBServer process is stopped.",
"ob_cluster_type_native": "PRIMARY",
"app_zh_tw": "OceanBase",
"metrics": "observer_boot_time_delta_seconds",
"ocp_ip": "xxx.xxx.xxx.xxx",
"value_shown": "20,245 days 5 hours 35 minutes 40 seconds",
"alarm_name": "OBServer process stopped",
"alarm_status_zh_tw": "警示中",
"vpc_name": "system-default",
"related_tenant_names": "sys,mysql,oracle",
"values": "1749188140",
"alarm_level_zh_tw": "嚴重",
"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 is 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 進程停止",
"ob_cluster_type_zh_cn": "Main",
"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: The OBServer process stops.",
"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 stop",
"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: The request queue of the OceanBase tenant is exceeded. Request waiting time of the tenant: ${request_queue_time_value_zh_cn}, the length of the request queue is greater than 0 and less than or equal to 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 exceeded",
"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, Auto-healing",
"host": "xxx.xxx.xxx.xxx",
"alarm_scope": "Tenant",
"ob_cluster": "ob4352_X",
"alarm_description_zh_tw": "Cluster: ob4352_X, Tenant: META$1004, Alert: The request queue of the OceanBase tenant exceeds the threshold. The tenant requests wait time: ${request_queue_time_value_zh_tw}, The length of the request queue 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": "Alarm",
"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 exceeded the maximum size.",
"ob_cluster_type_zh_tw": "Master",
"alarm_description": "Cluster: ob4352_X, Tenant: META$1004, Alert: OceanBase tenant request queue limit exceeded. Tenant request waiting 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 limit exceeded",
"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 limit exceeded",
"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": "OceanBase tenant request queue limit exceeded",
"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": "OceanBase tenant request queue limit exceeded",
"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 limit exceeded. Tenant request waiting 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,Autoheal"
},
"level": 3,
"messagePush": {
"configured": true,
"noSuccessCount": 0,
"successCount": 6
},
"name": "OceanBase tenant request queue limit exceeded",
"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 limit exceeded",
"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"
}
