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

GetAlarmAttribution

最近更新时间2023.04.11 16:29:02

首次发布时间2022.11.01 11:26:01

调用GetAlarmAttribution接口获取归因信息。

使用说明

  • 接口名称:GetAlarmAttribution
  • 请求方式:POST
  • 接口地址:/?Action=GetAlarmAttribution&Version=2022-10-12

请求参数

Query

参数

类型

是否必选

示例值

描述

Action

String

GetAlarmAttribution

请求名称。

Version

String

2022-10-12

请求版本。

ServiceName : apmplus_openapi
Region : cn-beijing 
X-App-Ids : xxx
Content-Type : application/json

Body

参数

类型

是否必填

示例值

说明

alarm_param

array

-

报警任务参数列表。

strategy_id

int

0

报警策略下标。表示归因的策略在alarm_param.strategy_list中的下标值。

attribution_time

int64

1666012500

报警归因终止时间。归因时间范围为[alarm_attribution_time-alarm_window_size*60, alarm_attribution_time]。

group_by_value

string

Chrome Webview

归因维度key。调用GetAlarmMetricRelatedMeta接口查看取值。

common

object of common

-

通用参数。

alarm_param_list

参数

类型

是否必填

示例值

说明

id

int

1

报警任务ID。

name

string

test

报警任务名。

alarm_level

string

warning

报警级别。

  • warning
  • fatal

desc

string

-

报警说明。

category

string

pageview

报警类别key。调用由GetAlarmMeta接口查看取值。

  • data.measure_category_meta_list[i].key

interval_seconds

int32

300

报警任务执行间隔。

  • 300:5分钟
  • 600:10分钟
  • 1800:30分钟
  • 3600:60分钟

strategy_op

string

and

报警多策略关系。

  • and:同时满足所有策略
  • or:满足任一策略

strategy_list

object of strategy_list

-

报警策略列表。

alarm_period

object of alarm_period

-

报警生效时间。时间范围外的报警不通知。

notify_config

object of notify_config

-

报警任务通知配置。

is_avoid_spike

bool

false

报警优化,是否过滤尖刺报警。

is_close

int8

0

是否关闭报警。

  • 0:开启
  • 1:关闭

pct_avoid_spike

object of pct_avoid_spike

-

pct报警参数,当开启pct报警屏蔽时必填。

strategy_list

参数

类型

是否必填

示例值

说明

alarm_window_size

int32

180

报警任务查询时间窗口,表示最近X分钟。单位为分钟。

measure

object of measure

-

指标集合。

alarm_strategy_type

string

threshold

报警策略类型。

  • threshold:阈值报警
  • cmp_last_n_day:比值报警

daily_compare_count

int32

5

上一周期与当前周期的时间间隔。
当报警策略为比值报警时必填,分钟单位,比如比前1天值为1440。

threshold_cmp_op

string

gt

策略符号。

  • 可选值为比值报警时,取值为gt、lt
  • 可选值为阈值报警时,取值为lt、lte、gt、gte

alarm_threshold

int32

10

报警阈值。

group_bys

object of group_bys

-

报警分组维度。

attribution_dimensions

object of attribution_dimensions

-

报警归因维度。

filter_list

object of filter_list

-

报警策略筛选条件。

alarm_user_threshold

int32

1

用户数阈值。

alarm_sample_threshold

int32

1

样本量阈值。

measure

参数

类型

是否必填

示例值

说明

type

string

monomial

指标类型。

  • monomial:普通指标
  • polynomial:复合指标

raw_measure_list

array

-

指标集合的列表。

formula

string

-

指标四则运算公式。
当指标类型为复合指标polynomial时选填。

name

string

PV

指标名。
当指标为普通指标时为指标名,指标为复合指标时为自定义指标名。

raw_measure_list

参数

类型

是否必填

示例值

说明

measure_name

string

pv_uv.count

简单指标key。调用GetAlarmMetaGetAlarmEventMetaMetric接口查看取值。

event_name

string

-

自定义事件key。当指标为自定义事件指标时必填。

filter_list

object of filter_list

-

筛选条件。当指标类型为复合指标时单个简单指标携带条件时选填。

filter_list

参数

类型

是否必填

示例值

说明

filter_name

string

browser_brand

筛选条件key。调用GetAlarmMetricRelatedMeta接口查看取值。

op

string

in

条件符号。

  • in
  • not_in
  • Regex
  • not_regex

values

array

["Chrome"]

筛选条件值。调用GetAlarmMetricCandidate接口查看取值。

group_bys

参数

类型

是否必填

示例值

说明

label

string

pid

分组指标。

group_by_name

string

pid

分组维度key。调用GetAlarmMetricRelatedMeta接口查看取值。

attribution_dimensions

参数

类型

是否必填

示例值

说明

label

string

pid

归因指标。

group_by_name

string

pid

归因维度key。调用GetAlarmMetricRelatedMeta接口查看取值。

alarm_period

参数

类型

是否必填

示例值

说明

start_time

int32

0

报警生效开始时间。
值为开始时间相对当天0点的秒时间戳,比如生效开始时间为当天2点,值为7200。

end_time

int32

86399

报警生效结束时间。
值为结束时间相对当天0点的秒时间戳,比如生效结束时间为当天23:59:59,值为86399。

notify_config

参数

类型

是否必填

示例值

说明

notify_types

array

["mail"]

报警任务通知方式。

  • mail:邮箱
  • lark:飞书
  • wechat:企业微信
  • dingding:钉钉

notify_groups

array

[ 291 ]

报警通知邮件组ID列表。
当报警通知方法包含邮件时必填。

notify_lark_webhooks

array

[]

飞书通知webhooks列表。
当报警通知方式包含飞书时必填。

notify_wechat_webhooks

array

[]

企微通知webhooks列表。
当报警通知方式包含企微时必填。

notify_dingding_webhooks

array

[]

钉钉通知webhooks列表。
当报警通知方式包含钉钉时必填。

pct_avoid_spike

参数

类型

是否必填

示例值

说明

pct

int8

1

报警子窗口值。可选值为1~9。
当超过(含)X个子窗口的报警指标值超过设定的报警阈值时,才触发报警。

common

参数

类型

是否必填

示例值

说明

aid

int64

12345

应用ID。

os

string

webpro

服务类型。

返回参数

参数

类型

示例值

说明

err_detail

string

-

错误详情。

data

array

null

返回内容。
具体格式,请参见data结构。

error_msg

string

-

错误信息。

error_no

int

0

错误码。0为成功。

data

参数

类型

示例值

说明

alarm_category

string

performance

报警任务类型。

attribution_dimension

string

pid

归因维度key。

attribution_dimension_label

string

TOP pid

归因任务指标。

detail_list

array of detail_list

-

归因结果。

detail_list

参数

类型

示例值

说明

name

object

JS 监控列表

JS监控列表。

link

string

-

报警时间,为source[i][0]值的含义。

请求示例

POST https://open.volcengineapi.com/?Action=GetAlarmAttribution&Version=2022-10-12

{
    "common":{
        "aid":12345,
        "os":"webpro"
    },
    "alarm_param":{
        "id":1,
        "name":"test",
        "alarm_level":"warning",
        "desc":"",
        "category":"pageview",
        "interval_seconds":300,
        "strategy_op":"and",
        "strategy_list":[
            {
                "alarm_window_size":180,
                "measure":{
                    "type":"monomial",
                    "raw_measure_list":[
                        {
                            "measure_name":"pv_uv.count",
                            "event_name":"",
                            "filter_list":[
                                {
                                    "filter_name":"browser_brand",
                                    "values":[
                                        "Chrome"
                                    ],
                                    "op":"in"
                                }
                            ]
                        }
                    ],
                    "formula":"",
                    "name":"PV",
                    "unit":{
                        "unit_type":"",
                        "unit":""
                    }
                },
                "alarm_strategy_type":"threshold",
                "daily_compare_count":5,
                "threshold_cmp_op":"gt",
                "alarm_threshold":10,
                "group_bys":[
                    {
                        "label":"pid",
                        "group_by_name":"pid"
                    }
                ],
                "attribution_dimensions":[
                    {
                        "label":"pid",
                        "group_by_name":"pid"
                    }
                ],
                "filter_list":[
                    {
                        "filter_name":"pid",
                        "op":"in",
                        "values":[
                            "看板"
                        ]
                    }
                ],
                "alarm_user_threshold":1,
                "alarm_sample_threshold":1
            }
        ],
        "alarm_period":{
            "start_time":0,
            "end_time":86399
        },
        "notify_config":{
            "notify_types":[
                "mail"
            ],
            "notify_groups":[
                291
            ],
            "notify_lark_webhooks":[

            ],
            "notify_wechat_webhooks":[

            ],
            "notify_dingding_webhooks":[

            ]
        },
        "is_avoid_spike":false,
        "is_close":0,
        "pct_avoid_spike":{
            "pct":1
        }
    },
    "strategy_id":0,
    "attribution_time":1666012500,
    "group_by_value":"Chrome Webview"
}

返回示例

{
    "err_detail":"",
    "data":[
        {
            "alarm_category":"performance",
            "attribution_dimension":"pid",
            "attribution_dimension_label":"TOP pid",
            "detail_list":[
                {
                    "name":"JS 监控列表",
                    "link":""
                }
            ]
        },
        {
            "alarm_category":"performance",
            "attribution_dimension":"pid",
            "attribution_dimension_label":"TOP 同上周期比增长最快  pid",
            "detail_list":[
                {
                    "name":"JS 监控列表",
                    "link":""
                }
            ]
        }
    ],
    "error_msg":"",
    "error_no":0
}