Overview
You can call this API to query the details of a specified alert event.
API details
Constraints
You must have the read permission on the alert feature.
Request path
GET /api/v2/alarm/alarms/{id}
Request parameters
path:
Parameter |
Type |
Example value |
Description |
|---|---|---|---|
| id | Integer | 1023 | The ID of the alert. |
Response parameters
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The data returned. |
| ├─ contents | Object | The information about the alert. For more information, see Data structure of an alert. |
| 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. |
Data structure of an alert
Parameter |
Type |
Description |
|---|---|---|
| id | Integer | The ID of the alert. |
| appType | String | The application type. Valid values:
|
| alarmType | String | The alert type. |
| scope | String | The alert scope. Valid values:
|
| level | Integer | The alert 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 alert status. Valid values:
|
| target | String | The target object of the alert. This value is generated based on the target template in the alert rule. |
| summary | String | The summary of the alert. This value is generated based on the summary template in the alert rule. |
| description | String | The details of the alert. This value is generated based on the details template in the alert rule. |
| activeAt | Datetime | The time when the alert was generated. |
| resolvedAt | Datetime | The time when the alert was resolved. |
| updatedAt | Datetime | The time when the alert was last updated. |
| labels | Object | The labels and values of the alert. |
Examples
Request example
View details about the alert event with ID 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": "The cluster TEST_CLUSTER has an expired XA transaction in the tenant oracle. Session ID: 0. Transaction ID: 10609937150880685421. Transaction creation time: 2023-04-25T14:05:47.766+08:00. Transaction duration: 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": "The cluster TEST_CLUSTER has an expired XA transaction in the tenant oracle. Session ID: 0. Transaction ID: 10609937150880685421. Transaction creation time: 2023-04-25T14:05:47.766+08:00. Transaction duration: 5 hours 33 minutes 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": "The cluster TEST_CLUSTER has an expired XA transaction in the tenant oracle. Session ID: 0. Transaction ID: 10609937150880685421. Transaction creation time: 2023-04-25T14:05:47.766+08:00. Transaction duration: 5 hours 33 minutes 58.51 seconds.",
"alarm_description_zh_tw": "The cluster TEST_CLUSTER has an expired XA transaction in the tenant oracle. Session ID: 0. Transaction ID: 10609937150880685421. Transaction creation time: 2023-04-25T14:05:47.766+08:00. Transaction duration: 5 hours 33 minutes 58.51 seconds.",
"alarm_evaluation_interval": "20",
"alarm_is_build_in_rule": "true",
"alarm_level": "2",
"alarm_name": "An expired XA transaction exists in the OceanBase tenant.",
"alarm_name_en_us": "OceanBase tenant contains XA expired transaction",
"alarm_name_zh_cn": "An expired XA transaction exists in the OceanBase tenant.",
"alarm_name_zh_tw": "An expired XA transaction exists in the OceanBase tenant.",
"alarm_scope": "Tenant",
"alarm_status": "Active",
"alarm_summary": "alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 An expired XA transaction exists in the 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 An expired XA transaction exists in the OceanBase tenant.",
"alarm_summary_zh_tw": "alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 An expired XA transaction exists in the OceanBase 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": "5 hours, 33 minutes, and 58.51 seconds",
"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 小時 33 分 58.51 秒"
},
"level": 2,
"name": "XA transactions that have been suspended in an 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 XA transaction pending on OceanBase tenant",
"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"
}
