Function Description
You can call this API to query the details of a specified alert event.
API details
Constraints
The caller must have the read permission for the alert feature.
Request path
GET /api/v2/alarm/alarms/{id}
Request parameters
path:
| Name | Type | Example value | Description |
| id | Integer | 1023 | The ID of the alert. |
Response parameters
Basic data structure | Parameter | Type | Description |
| data | Object | The list of alert events. For more information, see Data structure of alert events. |
| 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 server that responded to the request. | Data structure of alert events | Parameter | Type | Description | | ----------- | -------- | ------------ |
| id | Integer | The ID of the alert. |
| appType | String | The application type (the source of the alert). Valid values:
Examples
Request example
View the details of the alert event whose ID is 1000159.
GET /api/v2/alarm/alarms/100159
Response example
{
"data": {
"activeAt": "2023-04-25T10:04:17Z",
"alarmTarget": {
"appType": "OceanBase",
"excludeTargets": [],
"includeTargets": [
{
"cluster": {
"clusterId": 1,
"name": "TEST_CLUSTER",
"obClusterId": 12
},
"tenants": [
{
"name": "oracle",
"obTenantId": 1002,
"tenantId": 3
}
]
}
],
"scope": "Tenant"
},
"alarmTemplateId": 0,
"alarmType": "ob_tenant_exists_expired_xa_trans",
"appType": "OceanBase",
"description": "Cluster: TEST_CLUSTER, tenant: oracle. XA hanging transactions are found. Session ID: 0. Transaction ID: 10609937150880685421. Transaction created at 2023-04-25T14:05:47.766+08:00. The transaction has been running for 5 hours 33 minutes 58.51 seconds.",
"gmtCreate": "2023-04-25T10:04:17Z",
"gmtModified": "2023-04-25T11:40:17.397559Z",
"id": 3000024,
"labels": {
"alarm_active_at": "2023-04-25T10:04:17Z",
"alarm_description": "Cluster: TEST_CLUSTER, tenant: oracle. There is a distributed transaction in the suspended state. Session ID: 0. Transaction ID: 10609937150880685421. Transaction created at 2023-04-25T14:05:47.766+08:00. Transaction duration exceeds 5 hours 33 minutes and 58.51 seconds.",
"alarm_description_en_us": "OceanBase cluster: TEST_CLUSTER, tenant: oracle, expired XA transactions exist. Session id: 0, Trans id: 10609937150880685421, trans create time: 2023-04-25T14:05:47.766+08:00, the max trans duration: 5 hours 33 mins 58.51 secs.",
"alarm_description_zh_cn": "Cluster: TEST_CLUSTER, tenant: oracle has a global transaction in the XA SUSPENDED state. Session ID: 0, transaction ID: 10609937150880685421, Transaction start time: 2023-04-25T14:05:47.766+08:00, Transaction duration: 5 hours 33 minutes 58.51 seconds.",
"alarm_description_zh_tw": "Cluster: TEST_CLUSTER, Tenancy: oracle. An XA suspended transaction exists. Session ID: 0, Transaction ID: 10609937150880685421, Transaction creation time: 2023-04-25T14:05:47.766+08:00, Transaction duration: 5 hours, 33 minutes, and 58.51 seconds.",
"alarm_evaluation_interval": "20",
"alarm_is_build_in_rule": "true",
"alarm_level": "2",
"alarm_name": "XA hanging transaction in OceanBase tenant",
"alarm_name_en_us": "OceanBase tenant contains XA expired transaction",
"alarm_name_zh_cn": "XA transaction remains pending for an OceanBase tenant",
"alarm_name_zh_tw": "OceanBase租戶存在XA懸掛事務",
"alarm_scope": "Tenant",
"alarm_status": "Active",
"alarm_summary": "alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 XA transaction hung in OceanBase tenant",
"alarm_summary_en_us": "alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 OceanBase tenant contains XA expired transaction",
"alarm_summary_zh_cn": "alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 OceanBase tenant has a XA transaction that is in a pending state",
"alarm_summary_zh_tw": "alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 A transaction with an XA status of Suspend has been found in the OceanBase cluster tenant.",
"alarm_target": "alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421",
"alarm_template_id": "0",
"alarm_threshold": "1200",
"alarm_type": "ob_tenant_exists_expired_xa_trans",
"alarm_updated_at": "2023-04-25T11:40:17Z",
"app": "OceanBase",
"app_type": "OceanBase",
"cluster_id": "1",
"is_xa_trans": "1",
"message_type": "Alarm",
"metrics": "xa_trans_max_duration_seconds",
"ob_cluster": "TEST_CLUSTER",
"ob_cluster_id": "12",
"ob_cluster_name": "TEST_CLUSTER",
"ob_tenant": "oracle",
"ob_tenant_id": "1002",
"obregion": "TEST_CLUSTER",
"ocp_ip": "127.1",
"session_id": "0",
"sql_alarm_type": "trans_stat",
"tenant_id": "3",
"tenant_name": "oracle",
"trans_create_time": "2023-04-25T14:05:47.766+08:00",
"trans_hash": "10609937150880685421",
"trans_id": "{hash:10609937150880685421, inc:404115548, addr:\"xxx.xxx.xxx.xxx:2882\", t:1677651496056481}",
"trans_max_duration_seconds": "20038.51",
"trans_state": "pending",
"trans_state_name": "PENDING_TRANSACTION",
"trans_type": "xa",
"trans_type_name": "XA_TRANSACTION",
"value": "20038.51",
"value_en_us": "5 hours 33 mins 58.51 secs",
"value_shown": "5h33m58.51s",
"value_zh_cn": "5 hours 33 minutes 58.51 seconds",
"value_zh_tw": "5 小時 33 分 58.51 秒",
"values": "20038.51",
"xa_trans_max_duration_seconds": "20038.51",
"xa_trans_max_duration_seconds_alarm_threshold": "1200",
"xa_trans_max_duration_seconds_value": "20038.51",
"xa_trans_max_duration_seconds_value_en_us": "5 hours 33 mins 58.51 secs",
"xa_trans_max_duration_seconds_value_zh_cn": "5 hours 33 minutes 58.51 seconds",
"xa_trans_max_duration_seconds_value_zh_tw": "5 hours 33 minutes 58.51 seconds"
},
"level": 2,
"name": "XAResource with a global transaction is suspended on the OceanBase tenant",
"obCluster": {
"appType": "OceanBase",
"excludeTargets": [],
"includeTargets": [
{
"cluster": {
"clusterId": 1,
"name": "TEST_CLUSTER",
"obClusterId": 12
}
}
],
"scope": "Cluster"
},
"scope": "Tenant",
"status": "Active",
"statusUpdatedAt": "2023-04-25T10:04:17Z",
"summary": "alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 OceanBase tenant has a pending XA transaction.",
"target": "alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421",
"targetLabels": {
"alarm_template_id": "0",
"ob_cluster": "TEST_CLUSTER",
"ob_cluster_id": "12",
"tenant_name": "oracle",
"trans_hash": "10609937150880685421"
},
"updatedAt": "2023-04-25T11:40:17Z"
},
"duration": 10,
"server": "127.1",
"status": 200,
"successful": true,
"timestamp": "2023-04-25T19:40:27.475+08:00",
"traceId": "6f6a24af73b14704"
}
"timestamp": "2023-04-25T19:40:27.475+08:00", "traceId": "6f6a24af73b14704" }
