Overview
You can call this API to get the alert history.
API details
Constraints
You must be authorized 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 | The application category (the source of the alert). Valid values:
|
| scope | String | No | Cluster | The scope of the alert. Valid values:
|
| target | Array | No | alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 | The target of the alert, which is generated based on the target template of the alert rule. |
| alarmType | String | No | ob_tenant_exists_expired_xa_trans | The type of the alert. |
| level | Array | No | 1 | The alert level. Valid values: 1 to 5. 1 corresponds to Down, 2 to Critical, 3 to Alert, 4 to Caution, and 5 to Info. |
| alarmGroupIds | integer | No | [1,2,3] | The IDs of the alert groups, which are separated with commas. |
| status | Array | No | Active | The status of the alert. Valid values:
|
| activeAtStart | String | No | 2020-11-11T11:12:13.127+08:00 | The start time when the alert is triggered. |
| activeAtEnd | String | No | 2020-11-11T17:11:13.127+08:00 | The end time when the alert is triggered. |
| 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 application type. Valid values:
|
| alarmType | String | The type of the alarm. |
| scope | String | The scope of the alarm. Valid values:
|
| level | Integer | The alarm level. 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 about 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 are 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 about 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 the alarm contains an abnormal snapshot. |
| containSelfcure | Boolean | Indicates whether the alarm contains self-healing. |
| resolveComment | String | The remarks about the resolution of the alarm. |
AlarmTarget data structure
Parameter |
Type |
Description |
|---|---|---|
| appType | String | The application type. Valid values:
|
| scope | String | The scope of the alarm. Valid values:
|
| includeTargets | Array | The alarm targets to be included (positive selection). |
| excludeTargets | Array | The alarm targets to be excluded (negative selection). |
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 contains labeled metrics. Default value: false. |
| order | Integer | The sorting parameter. |
MessagePush
Parameter |
Type |
Description |
|---|---|---|
| configured | Boolean | Indicates whether to configure message push. |
| successCount | Integer | The number of messages that are pushed. |
| noSuccessCount | Integer | The number of messages that are not pushed. |
page
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": "xx.xx.xx.xx",
"id": 5
}]
}],
"scope": "Host"
},
"alarmTemplateId": 0,
"alarmType": "observer_process_stop",
"appType": "OceanBase",
"autoResolved": true,
"containSelfcure": false,
"description": "Cluster: ob3245_ps, host: xx.xx.xx.xx, 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": "xx.xx.xx.xx",
"value_zh_tw": "20,245 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=xx.xx.xx.xx OBServer process stops",
"alarm_summary_en_us": "alarm_template_id=0:ob_cluster=ob3245_ps-1731295860:host=xx.xx.xx.xx OBServer process stopped",
"alarm_type": "observer_process_stop",
"alarm_status": "Active",
"alarm_group_zh_tw": "Database kernel",
"host": "xx.xx.xx.xx",
"alarm_scope": "Host",
"alarm_scope_native": "Host",
"ob_cluster": "ob3245_ps",
"alarm_description_zh_tw": "Cluster: ob3245_ps; Server: xx.xx.xx.xx; 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 minutes 40 seconds",
"level": "2",
"related_svr_ips": "xx.xx.xx.xx",
"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": "20245 days 5 hours 35 minutes 40 seconds",
"alarm_description_en_us": "OceanBase cluster: ob3245_ps, host: xx.xx.xx.xx, 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=xx.xx.xx.xx OBServer process stopped",
"ob_cluster_type_zh_tw": "Primary",
"alarm_description": "Instance: ob3245_ps, Host: xx.xx.xx.xx, Alarm: The OBServer process has stopped.",
"ob_cluster_type_native": "PRIMARY",
"app_zh_tw": "OceanBase",
"metrics": "observer_boot_time_delta_seconds",
"ocp_ip": "xx.xx.xx.xx",
"value_shown": "20245 days 5 hours 35 minutes 40 seconds",
"alarm_name": "OBServer process stop",
"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=xx.xx.xx.xx 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=xx.xx.xx.xx",
"app_en_us": "OceanBase",
"value": "1749188140",
"alarm_name_zh_tw": "OBServer 進程停止",
"ob_cluster_type_zh_cn": "Primary",
"observer_boot_time_delta_seconds_value": "1749188140",
"__ob_server.id": "5",
"host_ip": "xx.xx.xx.xx",
"related_ob_cluster_name": "ob3245_ps",
"ob_cluster_name": "ob3245_ps",
"alarm_name_zh_cn": "OBServer process is 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: xx.xx.xx.xx, alarm: OBServer process has 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": "The OBServer process stops",
"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=xx.xx.xx.xx OBServer process has been stopped",
"target": "alarm_template_id=0:ob_cluster=ob3245_ps-1731295860:host=xx.xx.xx.xx",
"updatedAt": "2025-06-06T05:36:51Z"
},
{
"activeAt": "2025-06-06T02:57:52Z",
"alarmGroups": ["Database Core", "Autocure"],
"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 number of pending requests for the OceanBase tenant is greater than the threshold. The waiting time for a request: ${request_queue_time_value_zh_cn} ms, pending request count: 0, threshold: -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": "xx.xx.xx.xx",
"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=xx.xx.xx.xx OceanBase tenant request queue exceeds the limit",
"alarm_summary_en_us": "alarm_template_id=0:ob_cluster=ob4352_X-1731295861:tenant_name=META$1004:host=xx.xx.xx.xx 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": "xx.xx.xx.xx",
"alarm_scope": "Tenant",
"ob_cluster": "ob4352_X",
"alarm_description_zh_tw": "Cluster: ob4352_X, Tenant: META$1004, Alert: The request queue in the OceanBase tenant is full. The request wait time is ${request_queue_time_value_zh_tw}. The request queue length is 0, which is more than -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": "xx.xx.xx.xx",
"alarm_name_en_us": "OceanBase tenant request queue over threshold",
"message_type": "Alarm",
"alarm_status_zh_cn": "Alerted",
"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=xx.xx.xx.xx OceanBase tenant queue overflow",
"ob_cluster_type_zh_tw": "Primary",
"alarm_description": "Instance: ob4352_X, Tenant: META$1004, Alert: The request queue of the OceanBase tenant has reached the maximum limit. Request waiting time: ${request_queue_time_value_zh_cn}, Request queue length is 0, which exceeds -1.",
"ob_cluster_type_native": "PRIMARY",
"app_zh_tw": "OceanBase",
"metrics": "request_queue_time,ob_tenant_request_queue_size",
"ocp_ip": "xx.xx.xx.xx",
"value_shown": "0",
"tenant_id": "1003",
"alarm_name": "Request queue of OceanBase tenant over capacity",
"alarm_status_zh_tw": "警示中",
"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=xx.xx.xx.xx OceanBase tenant requests exceed the threshold",
"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=xx.xx.xx.xx",
"tenant_role_zh_tw": "Primary",
"app_en_us": "OceanBase",
"value": "0",
"alarm_name_zh_tw": "OceanBase Tenant request queue threshold exceeded",
"ob_cluster_type_zh_cn": "Primary",
"host_ip": "xx.xx.xx.xx",
"related_ob_cluster_name": "ob4352_X",
"ob_cluster_name": "ob4352_X",
"alarm_name_zh_cn": "OceanBase tenant 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": "The following alert is generated on the ob4352_X cluster: the request waiting time is ${request_queue_time_value_zh_cn} and the request queue length 0 exceeds -1. The related tenant is META$1004.",
"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, autohealing"
},
"level": 3,
"messagePush": {
"configured": true,
"noSuccessCount": 0,
"successCount": 6
},
"name": "Request queue is full for an OceanBase tenant",
"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=xx.xx.xx.xx OceanBase tenant request queue exceeds limits",
"target": "alarm_template_id=0:ob_cluster=ob4352_X-1731295861:tenant_name=META$1004:host=xx.xx.xx.xx",
"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"
}
