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

GetAppAlarmTrend

最近更新时间2023.12.26 16:39:07

首次发布时间2022.11.18 17:53:52

调用GetAppAlarmTrend接口获取App报警趋势。

使用说明

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

请求参数

Query

参数

类型

是否必选

示例值

描述

Action

String

GetAppAlarmTrend

请求名称。

Version

String

2022-10-12

请求版本。

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

Body

参数

类型

是否必选

示例值

描述

aid

i64

123456

应用ID。

monitor_types

array of string

["crash"]

监控类型。

  • crash:崩溃
  • crash_defend:崩溃防护
  • lag:卡顿
  • flutter_crash:flutter监控
  • app_page_js_err:页面监控/js错误
  • app_page_ajax_err:页面监控/请求错误
  • app_page_perf:页面监控/性能
  • app_event:事件报警
  • net_err:网络错误
  • custom_exception:自定义错误
  • traffic_exception:流量
  • disk_exception:磁盘
  • battery_trace:电量
  • cpu_exception:CPU

filters

object of Filter

-

过滤条件。

start_time

i64

1665417600

开始时间。

end_time

i64

1666417600

终止时间。

granularity

i64

1440

聚合度,单位分钟。

group_by_field

string

rule_id

分组字段,不分组的情况下传空字符串。

Filter

参数

类型

是否必选

示例值

描述

type

string

expression

筛选条件类型。

  • expression:表达式
  • map:映射
  • and:且条件
  • or:或条件

op

string

in

操作符。

  • in:包含

dimension

string

aid

条件的名称。

values

array of string

[123456]

筛选值,支持多个。

value

string

[123456]

筛选值。

map_key

string

key_1

map类型key,当type为map时必填。

sub_conditions

array of Filter

-

子条件。

返回参数

参数

类型

示例值

描述

data

array of Data

-

报警趋势。

error_msg

string

-

错误信息,成功为空。

error_no

i32

0

错误码,成功为0。

Data

参数

类型

示例值

描述

name

string

test

线的名称,在分组的情况下,name应该是分组维度的取值,比如用来显示曲线的图标。

points

array of Point

-

曲线上的点。

Point

参数

类型

示例值

描述

timestamp

i64

1653696000

unix时间戳。

readable_timestamp

string

2022-05-28 08:00:00

日历时间。

value

double

0

指标值。

请求示例

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

{
    "aid": 123456,
    "start_time": 1665417600,
    "end_time": 1666417600,
    "granularity": 1440,
    "monitor_types": [
        "crash"
    ],
    "filters": {
        "sub_conditions": [
            {
                "op": "in",
                "values": [
                    "717"
                ],
                "type": "expression",
                "dimension": "aid"
            }
        ],
        "type": "expression"
    },
    "group_by_field": "rule_id"
}

返回示例

正常返回示例

{
    "err_detail":"",
    "error_msg": "",
    "error_no": 0,
    "data": [
        {
            "name": "test",
            "points": [
                {
                    "readable_timestamp": "2022-05-28 08:00:00",
                    "timestamp": 1653696000,
                    "value": 915
                }
            ]
        }
    ]
}

异常返回示例

{
    "ResponseMetadata": {
        "RequestId": "20180*****2D30",
        "Action": "GetAppAlarmTrend",
        "Version": "2022-10-12",
        "Service": "***",
        "Region": "cn-north-1",
        "Error": {
            "Code": "200000",
            "Message": "参数异常"
        }
    }
}