Query alert events

2024-11-06 03:13:28  Updated

Description

You can call this operation to query the details of a specific alert event.

Call description

Prerequisite

You have the alert read permissions.

Request path

GET /api/v2/alarm/alarms/{id}

Request parameters

Parameter Type Example Description
id Integer 1023 The ID of the alert event.

Response parameters

  • Basic data structure

    Parameter Type Description
    data Object The request data.
    ├─ contents Object The alert event. The subsequent table describes its data structure.
    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 An 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 event

    Parameter Type Description
    id Integer The ID of the alert event.
    appType String The application type. Valid values: * OB * OCP * OMS * OBProxy * Backup
    alarmType String The alert type.
    scope String The alert scope. Valid values: * ObCluster * ObTenant * AppCluster * Service * Host
    level Integer The alert level. Valid values: 1, 2, 3, 4, 5, corresponding to Stopped, Critical, Warning, Caution, and Reminder.
    status String The alert status. Valid values: * Active * Inactive * Silenced * Inhibited
    target String The target object of the alert event. This parameter is generated based on the target template of the alert rule.
    summary String The overview of the alert event. This parameter is generated based on the overview template of the alert rule.
    description String The details of the alert event. This parameter is generated based on the details template of the alert rule.
    activeAt Datetime The time when the alert event was generated.
    resolvedAt Datetime The time when the alert event was cleared.
    updatedAt Datetime The time when the alert event was updated.
    labels Object The label and value of the alert event.

Examples

Sample request

View the details of alert event ID 1000159.

GET /api/v2/alarm/alarms/100159

Sample response

{
    "data": {
        "activeAt": "2020-12-03T00:52:03Z",
        "alarmType": "no_enough_exporter",
        "appType": "OCP",
        "description": "service=OCP:svr_ip=xxx.xxx.xxx.xxx. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
        "gmtCreate": "2020-12-03T00:52:03Z",
        "gmtModified": "2020-12-03T01:10:12.300278Z",
        "id": 1000159,
        "labels": {
            "alarm_name": "Insufficient exporter processes",
            "app_type": "OCP",
            "svr_ip": "xxx.xxx.xxx.xxx",
            "alarm_description_3": "service=OCP:svr_ip=xxx.xxx.xxx.xxx. The number of exporter processes is insufficient.",
            "host_services": "OB_CLUSTER,OB_PROXY",
            "alarm_level": "Stopped",
            "alarm_description_1": "service=OCP:svr_ip=xxx.xxx.xxx.xxx. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
            "alarm_name_3": "Insufficient exporter processes",
            "alarm_description_2": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter number not enough, deployed services OB_CLUSTER,OB_PROXY,  expected exporter count 6, actual exporter count 5",
            "alarm_name_2": "exporter number not enough",
            "expected_exporter_count": "6",
            "alarm_name_1": "Insufficient exporter processes",
            "alarm_type": "no_enough_exporter",
            "alarm_summary": "service=OCP:svr_ip=xxx.xxx.xxx.xxx. The number of exporter processes is insufficient.",
            "alarm_status": "Inactive",
            "alarm_scope": "Host",
            "alarm_active_at": "2020-12-03T00:52:03Z",
            "alarm_target": "service=OCP:svr_ip=xxx.xxx.xxx.xxx",
            "alarm_resolved_at": "2020-12-03T01:10:12Z",
            "app": "OCP",
            "actual_exporter_count": "5",
            "alarm_is_build_in_rule": "true",
            "host_ip": "xxx.xxx.xxx.xxx",
            "alarm_duration": "0",
            "service": "OCP",
            "alarm_description": "service=OCP:svr_ip=xxx.xxx.xxx.xxx. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
            "alarm_updated_at": "2020-12-03T01:05:03Z",
            "alarm_summary_2": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter number not enough",
            "alarm_summary_1": "service=OCP:svr_ip=xxx.xxx.xxx.xxx. The number of exporter processes is insufficient.",
            "alarm_summary_3": "service=OCP:svr_ip=xxx.xxx.xxx.xxx. The number of exporter processes is insufficient.",
            "alarm_evaluation_interval": "60"
        },
        "level": 1,
        "resolvedAt": "2020-12-03T01:10:12Z",
        "scope": "Host",
        "status": "Inactive",
        "summary": "service=OCP:svr_ip=xxx.xxx.xxx.xxx. The number of exporter processes is insufficient.",
        "target": "service=OCP:svr_ip=xxx.xxx.xxx.xxx",
        "updatedAt": "2020-12-03T01:05:03Z"
    },
    "duration": 8,
    "server": "a83ad33525",
    "status": 200,
    "successful": true,
    "timestamp": "2020-12-03T09:48:54.98+08:00",
    "traceId": "2ad80c3bac1b4ad7"
}

Contact Us