Function description
Queries the details of a specified alert event.
Call instructions
Interface constraints
The caller must have the read permission for 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. |
Return result
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The list of alert events. For more information, see Alert event data structure. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server completes the request. |
| duration | Integer | The time taken by the server to process the request (in milliseconds). |
| status | Integer | The HTTP status code that conforms to the HTTP status specification. |
| traceId | String | The Trace ID of the request, which is used to troubleshoot issues. |
| server | String | The address of the server that responds to the request. |
Alert event data structure
Parameter |
Type |
Description |
|---|---|---|
| id | Integer | The ID of the alert. |
| appType | String | The application type (alert source). Valid values: |
| alarmType | String | The type of the alert. |
| scope | String | The scope of the alert. Valid values: |
| level | Integer | The alert level, which ranges from 1 to 5. The corresponding alert levels are: Down, Critical, Alert, Caution, and Info. |
| status | String | The alert status. Valid values: |
| target | String | The target object of the alert, which is generated based on the target template in the alert rule. |
| summary | String | The summary of the alert, which is generated based on the summary template in the alert rule. |
| description | String | The details of the alert, which are generated based on the details template in the alert rule. |
| activeAt | Datetime | The time when the alert is generated. |
| resolvedAt | Datetime | The time when the alert is resolved. |
| updatedAt | Datetime | The time when the alert is updated. |
| labels | Object | The labels and values of the alert. |
Example
Request example
View the details of the alert event with ID 1000159.
GET /api/v2/alarm/alarms/100159
Sample response
{
"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": "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.",
"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": "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_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": "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_tw": "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_evaluation_interval": "20",
"alarm_is_build_in_rule": "true",
"alarm_level": "2",
"alarm_name": "OceanBase tenant contains XA expired transaction",
"alarm_name_en_us": "OceanBase tenant contains XA expired transaction",
"alarm_name_zh_cn": "OceanBase tenant contains XA expired transaction",
"alarm_name_zh_tw": "OceanBase tenant contains XA expired transaction",
"alarm_scope": "Tenant",
"alarm_status": "Active",
"alarm_summary": "alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 OceanBase tenant contains XA expired transaction",
"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 contains XA expired transaction",
"alarm_summary_zh_tw": "alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 OceanBase tenant contains XA expired transaction",
"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 mins 58.51 secs",
"value_zh_cn": "5 hours 33 mins 58.51 secs",
"value_zh_tw": "5 hours 33 mins 58.51 secs",
"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 mins 58.51 secs",
"xa_trans_max_duration_seconds_value_zh_tw": "5 hours 33 mins 58.51 secs"
},
"level": 2,
"name": "OceanBase tenant contains XA expired transaction",
"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 contains XA expired 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"
}
