You need to enable JavaScript to run this app.
导航

PCAlarmDetail

最近更新时间2023.12.26 19:24:28

首次发布时间2022.11.15 20:38:48

调用PCAlarmDetail接口查看报警详情。

请求参数

Query

参数

类型

是否必选

示例值

描述

Action

String

PCAlarmDetail

请求名称。

Version

String

2022-10-28

请求版本。

Body

参数

类型

是否必选

示例值

描述

common

object of common

-

通用参数。

id

i64

1

报警规则ID。

common

参数

类型

是否必选

示例值

描述

aid

i64

12345

App ID。

env

string

crash

环境信息。

os

string

pc

系统。

返回参数

参数

类型

示例值

描述

data

object of data

-

返回内容。

errmsg

string

""

错误信息,成功为空。

errno

i32

200

错误码,成功为 200。

data

参数

类型

示例值

描述

alarm_param

object of alarm_param

-

报警参数。

created_by

string

zhangsan

创建人。

updated_by

string

lisi

更新人。

created_time

i64

1667550612

创建时间。

updated_time

i64

1667550612

更新时间。

next_trigger_time

i64

1667550612

下次触发时间。

last_execute_time

i64

1668550612

上次执行时间。

ack_until_time

i64

1667550612

ack到期时间。

num_of_alarm_in_last_one_month

i32

-

上个月触发次数。

alarm_param

参数

类型

示例值

描述

id

i64

1

创建时不传,更新时传。

name

string

minitor

报警名称。

desc

string

新的报警

报警说明。

is_close

i8

1

是否关闭报警。

  • 0:开启
  • 1:关闭

category

string

pc_flexible

报警类型。

category_label

string

""

报警类型展示名称。

alarm_level

string

Warn

报警级别。

  • Notice
  • Warn
  • Fatal

strategy_list

array of strategy_list

[{id: "5422597736-1653918737621", measure: {type: "monomial",…},…}]

报警策略。

strategy_op

string

and

多策略关系。

  • and
  • or

interval_seconds

i32

300

报警间隔,最短5分钟。

alarm_period

object of alarm_period

-

报警时间。

notify_config

object of notify_config

-

报警通知。

pct_avoid_spike

object of pct_avoid_spike

-

pct报警参数。

strategy_list

参数

类型

示例值

描述

id

string

9018754602-1655285699772

当新建报警策略的时候前端生成,用于后端画趋势图。

measure

object of measure

-

指标集合。

filter_list

array of filter_list

[{op: "in", filter_name: "os", values: ["1"]}]

过滤条件。

alarm_strategy_type

string

threshold

指标计算策略。

  • 阈值:threshold
  • 同比:cmp_last_n_day

daily_compare_count

i32

60

同比支持过去x分钟。

alarm_threshold

double

10

报警阈值。

threshold_cmp_op

string

gt

报警阈值的op。

  • gt
  • gte
  • lt
  • lte
  • abs_gt
  • abs_gte

alarm_sample_threshold

double

3

样本数量阈值。

alarm_window_size

i64

180

时间窗口,单位为秒。

group_bys

array of group_bys

[{type: "", group_by_name: "os", label: "OS", group_by_number_terms: null},…]

报警的分组。

sample_metric

object of sample_metric

-

简单指标。

user_metric

object of user_metric

-

自定义指标。

alarm_period

参数

类型

示例值

描述

start_time

i32

0

开始时间,单位秒。

end_time

i32

86399

结束时间,单位秒。

notify_config

参数

类型

示例值

描述

notify_types

array of string

["mail"]

报警通知方式。

  • lark
  • mail
  • wechat
  • dingding

notify_lark_webhooks

array of string

["http://lark/url"]

飞书通知webhook列表。

notify_groups

array of string

[1,23]

邮件接收组ID列表。

notify_wechat_webhooks

array of string

["http://wechat/url"]

企业微信通知webhook列表。

notify_dingding_webhooks

array of string

["http://dingding/url"]

钉钉通知webhook列表。

upgrade_groups

array of string

[1,23]

升级邮件接收组ID列表。

pct_avoid_spike

参数

类型

示例值

描述

pct

i8

10

  • 10:pct10
  • 20:pct20

alarm_threshold

double

10

报警阈值。

measure

参数

类型

示例值

描述

type

string

monomial

指标类型。

  • monomial
  • polynomial

raw_measure_list

array of raw_measure_list

[{measure_name: "pc_crash_sink_chtb.user_ratio", filter_list: [], event_name: ""}]

具体查询指标。

name

string

崩溃影响用户数

指标名称。

customId

string

xe3ejx98

前端用于还原页面。

filter_list

参数

类型

示例值

描述

op

string

in

过滤方式。

filter_name

string

cpu

用于表明filter的那个维度。

values

array of string

["intel", "Qualcomm"]

过滤值。

group_bys

参数

类型

示例值

描述

group_by_name

string

os

分组维度。

label

string

OS

分组展示名称。

sample_metric

参数

类型

示例值

描述

type

string

monomial

指标类型。

  • monomial
  • polynomial

raw_measure_list

array of raw_measure_list

[{measure_name: "pc_crash_sink_chtb.user_ratio", filter_list: [], event_name: ""}]

具体查询指标。

name

string

崩溃影响用户数

指标名称。

customId

string

xe3ejx98

前端用于还原页面。

user_metric

参数

类型

示例值

描述

type

string

monomial

指标类型。

  • monomial
  • polynomial

raw_measure_list

array of raw_measure_list

[{measure_name: "pc_crash_sink_chtb.user_ratio", filter_list: [], event_name: ""}]

具体查询指标。

name

string

崩溃影响用户数

指标名称。

customId

string

xe3ejx98

前端用于还原页面

raw_measure_list

参数

类型

示例值

描述

measure_name

string

"{\metric\:\pc_flexible.count\,\event_dimension\:\pc_flexible.event_name\,\event_name\:\test_service_gyf\}"

具体的指标计算值。

filter_list

array of filter_list

[]

过滤条件。

event_name

string

test_service_gyf

前端传了此参数, 后端没有用到。但是还原图表的时候是从这个字段读的事件名。

请求示例

POST /?Action=PCAlarmDetail&Version=2022-10-28 
{
    "common": {
        "aid": 12345,
        "os": "pc",
        "site_type": "",
        "env": "crash"
    },
    "id": 1
}

返回示例

正常返回示例

{
    "data": {
        "num_of_alarm_in_last_one_month": 1,
        "alarm_param": {
            "name": "minitor",
            "desc": "新的报警",
            "is_close": 1,
            "category": "pc_flexible",
            "alarm_level": "Warn",
            "strategy_list": [
                {
                    "id": "9018754602-1655285699772",
                    "alarm_strategy_type": "threshold",
                    "alarm_threshold": 10,
                    "threshold_cmp_op": "gt",
                    "alarm_window_size": 180,
                    "alarm_sample_threshold": 3,
                    "group_bys": [
                        {
                            "group_by_name": "os",
                            "label": "OS"
                        }
                    ],
                    "filter_list": [
                        {
                            "op": "in",
                            "filter_name": "cpu",
                            "values": [
                                "intel",
                                "Qualcomm"
                            ]
                        }
                    ],
                    "daily_compare_count": 60
                }
            ],
            "strategy_op": "and",
            "interval_seconds": 300,
            "alarm_period": {
                "start_time": 820,
                "end_time": 86399
            },
            "category_label": "",
            "notify_config": {
                "notify_dingding_webhooks": [
                    "http://dingding/url"
                ],
                "notify_lark_webhooks": [
                    "http://lark/url"
                ],
                "notify_wechat_webhooks": [
                    "http://wechat/url"
                ],
                "upgrade_groups": [
                    1,
                    23
                ],
                "notify_groups": [
                    1,
                    23
                ],
                "notify_types": [
                    "mail"
                ]
            },
            "id": 1
        },
        "updated_time": 1667550612,
        "last_execute_time": 1668550612,
        "next_trigger_time": 1667550612,
        "ack_until_time": 1667550612,
        "updated_by": "lisi",
        "created_time": 1667550612,
        "created_by": "zhangsan"
    },
    "errno": 200,
    "errmsg": ""
}

异常返回示例

{
    "ResponseMetadata": {
        "RequestId": "2018****22D30",
        "Action": "PCAlarmDetail",
        "Version": "2022-10-28",
        "Service": "***",
        "Region": "cn-north-1",
        "Error": {
            "Code": "200000",
            "Message": "参数异常"
        }
    }
}