You need to enable JavaScript to run this app.
文档中心
应用性能监控全链路版

应用性能监控全链路版

复制全文
下载 pdf
报警
SaveAlarmRuleConf
复制全文
下载 pdf
SaveAlarmRuleConf
新建或更新 App 报警任务。​
请求说明​
客户端监控已在全球多个地域部署服务,旨在为您提供更稳定、低延迟的访问体验。您可以通过查阅 服务地址 文档,根据业务所在地选择最合适的接入点。​
  • 请求方式:POST​
  • 请求地址:https://apmplus-openapi.cn-beijing.volcengineapi.com?Action=SetAppAlarmRule&Version=2025-12-01​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数,更多详细信息参见 公共参数。​
说明​
调用本接口前,请在请求中传入必填的公共请求参数(如 x-app-ids),否则将调用失败。​
​
参数​
类型​
是否必选​
示例值​
描述​
Action​
String​
是​
SetAppAlarmRule​
接口名称。当前 API 的名称为 SetAppAlarmRule。​
Version​
String​
是​
2025-12-01​
接口版本。当前 API 的版本为 2025-12-01。​
Id​
Long​
否​
1​
报警规则 ID,新建规则时可不传。​
Name​
String​
是​
task_test​
规则名称。​
Description​
String​
是​
alarm for xxx​
规则描述。​
MonitorType​
String​
是​
crash​
异常类型。取值:​
  • crash:崩溃​
  • crash_defend:崩溃防护​
  • lag:卡顿​
  • app_page_js_err:页面监控/js错误​
  • app_page_ajax_err:页面监控/请求错误​
  • app_page_perf:页面监控/性能​
  • app_event:事件报警​
  • net_err:网络错误​
  • custom_exception:自定义错误​
AlarmLevel​
String​
是​
warning​
报警级别。取值:​
  • warning​
  • fatal​
CheckCycle​
Long​
是​
5​
监测周期,单位分钟,瞬时报警填 0。​
ActivationStart​
String​
否​
08:00​
全天生效时间起点,24 小时制,精确到分。​
ActivationEnd​
String​
否​
23:00​
全天生效时间终点,24 小时制,精确到分。​
Activations​
Array of Activation​
是​
[]​
多个生效时间段。​
Status​
Integer​
否​
0​
报警状态。取值:​
  • 1:启用​
  • 2:停用​
  • 0:删除​
Filter​
Object of FilterCondition​
是​
-​
报警指标筛选条件。​
GroupBys​
Array of GroupBy​
是​
[]​
报警分组条件。​
HitRule​
Object of AlarmHitRule​
是​
-​
报警触发条件。​
NoticeConf​
Object of AlarmNoticeConf​
是​
-​
通知配置信息。​
Brief​
String​
否​
​
规则概述信息。​
Count​
Long​
否​
1​
报警次数。​
UpdateAt​
String​
否​
2006-01-02 15:04:05​
更新时间,格式为 “yyyy-MM-dd HH:mm:ss”。​
OwnerId​
Long​
否​
123456​
规则 Owner 用户 ID。​
OwnerInfo​
Object of UserProfile​
否​
-​
规则 Owner 用户信息。​
RecentlyOccurTime​
String​
是​
​
最近发生时间,未发生时为空字符串。​
AckTime​
String​
是​
2006-01-02 15:04:05​
Ack 时间。​
AckStatus​
Integer​
是​
0​
ACK状态。​
  • 0:未ACK​
  • 1:ACK​
Os​
String​
是​
iOS​
操作系统。​
CallbackUrl​
String​
否​
https://www.baidu.com​
回调 URL。​
​
Activation​
​
参数​
类型​
是否必选​
示例值​
描述​
ActivationEnd​
String​
否​
23:00​
全天生效时间终点。24h 制,精确到分。例如晚上 9 点是 "21:00"。​
ActivationStart​
String​
否​
08:00​
全天生效时间起点。24h 制,精确到分。例如早上 9 点是 "09:00"。​
ActivationEndStamp​
Long​
否​
1665417900​
生效时间终点的时间戳。​
ActivationStartStamp​
Long​
否​
1665417600​
生效时间起点的时间戳。​
​
FilterCondition​
​
参数​
类型​
是否必选​
示例值​
描述​
Op​
String​
否​
in​
操作符。取值:​
  • gt:大于​
  • gte:大于等于​
  • lt:小于​
  • lte:小于等于​
  • eq:等于​
  • neq:不等于​
  • in:包含​
  • not_in:不包含​
  • lk:模糊匹配特定模式的数据​
  • nlk:排除模糊匹配的数据​
Type​
String​
否​
and​
条件类型。示例值:​
  • expression:当前条件为单一表达式。​
  • and:当前条件为复合表达式,各子条件 SubConditions 之间为逻辑“与”关系。​
  • or:当前条件为复合表达式,各子条件 SubConditions 之间为逻辑“或”关系。​
Value​
String​
否​
123456​
单个操作数。​
Values​
Array of String​
否​
[123456]​
操作数列表。​
Dimension​
String​
否​
aid​
条件维度名称。​
SubCondition​
Object of FilterCondition​
否​
-​
子条件。​
SubConditions​
Array of FilterCondition​
否​
-​
子条件列表。​
​
GroupBy​
​
参数​
类型​
是否必选​
示例值​
描述​
Dimension​
String​
否​
path​
分组名称。​
​
AlarmHitRule​
​
参数​
类型​
是否必选​
示例值​
描述​
Op​
String​
是​
gt​
比较符。取值:​
  • gt:大于​
  • gte:大于等于​
  • lt:小于​
  • lte:小于等于​
  • eq:等于​
Type​
String​
是​
and​
筛选条件类型。示例值:​
  • expression:当前条件为单一表达式。​
  • and:当前条件为复合表达式,各子条件 SubConditions 之间为逻辑“与”关系。​
  • or:当前条件为复合表达式,各子条件 SubConditions 之间为逻辑“或”关系。​
Indicator​
Object of Indicator​
否​
-​
阈值类型指标配置。​
Indicators​
Array of Indicator​
否​
-​
同环比类型指标配置。​
SubHitRule​
Object of AlarmHitRule​
否​
-​
子规则。​
HitRuleType​
String​
是​
threshold​
命中规则类型。取值:​
  • threshold:阈值​
  • compare:同环比​
SubHitRules​
Array of AlarmHitRule​
否​
[]​
子规则列表。​
ThresholdValue​
Double​
是​
10000​
报警阈值。​
ThresholdCalculateType​
String​
是​
-​
阈值计算方式,支持加减或百分比。​
​
AlarmNoticeConf​
​
参数​
类型​
是否必选​
示例值​
描述​
Type​
Array of String​
否​
mail​
通知类型。​
  • lark:飞书​
  • mail:邮箱​
  • dingding:钉钉​
  • wechat:企业微信​
LarkAtConf​
Object of AtConf​
否​
-​
飞书 @ 配置。​
LarkWebHooks​
Array of String​
否​
-​
飞书 Webhook 地址列表。​
WechatAtConf​
Object of AtConf​
否​
-​
企业微信 @ 配置。​
AlarmReceives​
Array of Candidate​
否​
-​
报警接收人/接收组。​
TitleTemplate​
String​
否​
-​
报警标题模板,可能包含特殊字符。​
DingdingAtConf​
Object of AtConf​
否​
-​
钉钉 @ 配置。​
WechatWebHooks​
Array of String​
否​
-​
企业微信 Webhook 地址列表。​
ContentTemplate​
String​
否​
-​
报警内容模板,可能包含特殊字符。​
DingdingWebHooks​
Array of String​
否​
-​
钉钉 Webhook 地址列表。​
​
UserProfile​
​
参数​
类型​
是否必选​
示例值​
描述​
Id​
Long​
否​
1​
用户 ID。​
Email​
String​
否​
test@test.com​
用户邮箱。​
Username​
String​
否​
test_name​
用户名。​
SsoUserId​
String​
否​
123456​
SSO 用户 ID。​
​
Indicator​
​
参数​
类型​
是否必选​
示例值​
描述​
Name​
String​
是​
crash_count​
指标定义名称,由 GetAppAlarmMetricsConf 接口获取。​
Value​
Double​
否​
10​
指标值。​
EndTime​
Long​
否​
1665417900​
统计结束时间。​
Recently​
Long​
是​
180​
指标查询时间范围,单位:分钟。​
StartTime​
Long​
否​
1665417600​
统计起始时间的时间戳。​
CompareTime​
Long​
是​
0​
比较时间。取值:​
  • 5:前五分钟​
  • 0:当前​
​
AtConf​
​
参数​
类型​
是否必选​
示例值​
描述​
IdType​
String​
否​
mobile​
ID 类型。取值:​
  • mobile​
  • userid​
  • openid​
IdValues​
Array of String​
否​
["123"]​
被 @ 的 ID 列表。​
​
Candidate​
​
参数​
类型​
是否必选​
示例值​
描述​
Email​
String​
否​
test@test.com​
用户邮箱。​
GroupId​
Integer​
否​
123​
接收组 ID。​
IsGroup​
Boolean​
否​
true​
是否接收组。取值:​
  • true:是接收组。​
  • false:非接收组。​
UserName​
String​
否​
test​
用户名。​
GroupName​
String​
否​
test​
接收组名。​
​
请求示例​
​
POST https://apmplus-openapi.cn-beijing.volcengineapi.com?Action=SetAppAlarmRule&Version=2025-12-01​
{​
"Id": 1,​
"Name": "task_test",​
"Description": "alarm for xxx",​
"MonitorType": "crash",​
"AlarmLevel": "warning",​
"CheckCycle": 5,​
"ActivationStart": "08:00",​
"ActivationEnd": "23:00",​
"Activations": [],​
"Status": 0,​
"Filter": {​
"Op": "in",​
"Type": "and",​
"Value": "123456",​
"Values": [​
123456​
],​
"Dimension": "aid",​
"SubCondition": {​
"Op": "in",​
"Type": "and",​
"Value": "123456",​
"Values": [​
123456​
],​
"Dimension": "aid",​
"SubCondition": {​
"description": "SubConditions",​
"title": "SubConditions。"​
},​
"SubConditions": []​
},​
"SubConditions": []​
},​
"GroupBys": [],​
"HitRule": {​
"Op": "gt",​
"Type": "and",​
"Indicator": {​
"Name": "crash_count",​
"Value": 10,​
"EndTime": 1665417900,​
"Recently": 180,​
"StartTime": 1665417600,​
"CompareTime": 0​
},​
"Indicators": [],​
"SubHitRule": {​
"Op": "gt",​
"Type": "and",​
"Indicator": {​
"description": "Threshold Metric Configuration",​
"title": "Threshold Metric Configuration。"​
},​
"Indicators": [],​
"SubHitRule": {​
"description": "Sub-rule",​
"title": "Sub-rule。"​
},​
"HitRuleType": "threshold",​
"SubHitRules": [],​
"ThresholdValue": 10000,​
"ThresholdCalculateType": "-"​
},​
"HitRuleType": "threshold",​
"SubHitRules": [],​
"ThresholdValue": 10000,​
"ThresholdCalculateType": "-"​
},​
"NoticeConf": {​
"Type": [​
""​
],​
"LarkAtConf": {​
"IdType": "mobile",​
"IdValues": [​
"123"​
]​
},​
"LarkWebHooks": [​
""​
],​
"WechatAtConf": {​
"IdType": "mobile",​
"IdValues": [​
"123"​
]​
},​
"AlarmReceives": [​
{​
"Email": "test@test.com",​
"GroupId": 123,​
"IsGroup": true,​
"UserName": "test",​
"GroupName": "test"​
}​
],​
"TitleTemplate": "-",​
"DingdingAtConf": {​
"IdType": "mobile",​
"IdValues": [​
"123"​
]​
},​
"WechatWebHooks": [​
""​
],​
"ContentTemplate": "-",​
"DingdingWebHooks": [​
""​
]​
},​
"Brief": "",​
"Count": 1,​
"UpdateAt": "2006-01-02 15:04:05",​
"OwnerId": 123456,​
"OwnerInfo": {​
"Id": 1,​
"Email": "test@test.com",​
"Username": "test_name",​
"SsoUserId": "123456"​
},​
"RecentlyOccurTime": "",​
"AckTime": "2006-01-02 15:04:05",​
"AckStatus": 0,​
"Os": "iOS",​
"CallbackUrl": "https://www.baidu.com"​
}
​
返回参数​
无。​
返回示例​
​
{​
"ResponseMetadata": {​
"Action": "SetAppAlarmRule",​
"Region": "cn-north-1",​
"Service": "apmplus_openapi",​
"Version": "2025-12-01",​
"RequestId": "20230604110420****100232280022D31"​
},​
"Result": "ok",​
"-": ""​
}
​
错误码​
当前接口暂无独立错误码,若接口调用返回异常,可参考 公共错误码 进行故障排查。​
最近更新时间:2026.10.21 16:47:31
这个页面对您有帮助吗?
有用
有用
无用
无用