调用PCAlarmRuleList接口查看报警列表。
请求参数
Query
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|
Action | String | 是 | PCAlarmRuleList | 请求名称 |
Version | String | 是 | 2022-10-28 | 请求版本 |
Body
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|
common | object of common | 是 | - | 通用参数 |
status | i8 | 否 | 0 | 监控状态 0:status_open 1:status_close: |
self | i8 | 否 | 1 | 管理状态0:全部不传1:我管理的 |
category_list | array of string | 否 | [pc_crash] | 报警类型 pc_flexiblepc_crash |
keyword | string | 否 | alarm | 搜索名称关键字 |
page_size | i32 | 是 | 3 | 每页规则数 |
page_num | i32 | 是 | 1 | 返回页码号 |
common
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|
aid | i64 | 是 | 12345 | App ID |
env | string | 否 | crash | 环境信息 |
os | string | 是 | pc | 系统 |
返回参数
参数 | 类型 | 示例值 | 描述 |
---|
data | object of data | - | 返回内容 |
errmsg | string | "" | 错误信息,成功为空 |
errno | i32 | 200 | 错误码,成功为 200 |
data
参数 | 类型 | 示例值 | 描述 |
---|
alarm_rule_list | array of alarm_rule_list | [ {"alarm_param":{...},"created_by": "root", "updated_by": "root" },...] | 报警规则列表 |
count | i32 | 30 | 报警规则总数 |
alarm_rule_list
参数 | 类型 | 示例值 | 描述 |
---|
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 | 时间窗口,单位s |
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"] | 报警通知方式 larkmailwechatdingding |
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=PCAlarmRuleList&Version=2022-10-28
{
"common": {
"aid": 12345,
"os": "pc",
"env": "crash",
"site_type": "nuclear"
},
"page_size": 3,
"page_num": 1,
"keyword": "alarm",
"self": 1,
"status": 250,
"category_list": "[pc_crash]"
}
正常返回示例
{
"errno": 200,
"data": {
"count": 30,
"alarm_rule_list": "[ {\"alarm_param\":{...},\"created_by\": \"root\", \"updated_by\": \"root\" },...]"
},
"errmsg": ""
}
异常返回示例
{
"ResponseMetadata": {
"RequestId": "201806041104200100100232280022D30",
"Action": "PCAlarmRuleList",
"Version": "2022-10-28",
"Service": "***",
"Region": "cn-north-1",
"Error": {
"Code": "200000",
"Message": "参数异常"
}
}
}