最近更新时间:2024.04.15 15:07:28
首次发布时间:2024.04.12 15:14:45
当告警策略被触发且满足发送告警通知的聚合条件后,云监控通过告警回调接口发送POST请求至指定的URL。指标告警回调请求内容包括回调请求头Header和回调请求体Body。
Header键 | Header值 | 说明 |
---|---|---|
x-volc-trace-id | 随机uuid | 用于请求追踪。 |
x-volc-rule-id | { rule_id } | 策略ID。 |
请求体的数据类型为application/json
。
参数 | 类型 | 示例值 | 说明 |
---|---|---|---|
Type | string | Metric | 告警类型。
|
AccountId | string | 20*****007 | 账户ID。 |
RuleName | string | 测试告警策略 | 策略名称。 |
RuleId | string | 1574726******98880 | 策略ID。 |
Namespace | string | VCM_FileNAS | 产品类型。 |
SubNamespace | string | latency | 维度。 |
Level | string | critical | 告警级别。
|
Resources | List of Resource | - | 资源详情。具体格式,请参见Resource结构。 |
RecoveredResources | List of RecoveredResources | - | 资源详情。具体格式,请参见Resource结构。 |
Resource结构
参数 | 类型 | 示例值 | 说明 |
---|---|---|---|
Id | string | enas-cn04*****45d06f | 资源ID。 |
Name | string | enas-cn04*****45d06f | 资源名称。 |
Region | string | cn-north-3 | 地域。 |
FirstAlertTime | integer | 1664332705 | 初次告警时间。 |
LastAlertTime | integer | 1664332705 | 本次告警发生时间。 |
Metrics | List of Metric | - | 告警指标及当前值。具体格式,请参见Metric结构。 |
Dimensions | List of Dimension | - | 资源维度信息。具体格式,请参见Dimension结构。 |
Metric结构
参数 | 类型 | 示例值 | 说明 |
---|---|---|---|
Name | string | Nfsv3WriteLatency | 指标名称。 |
Unit | string | ms | 指标的单位。 |
Threshold | float | 1 | 该策略下该指标阈值。 |
CurrentValue | float | 0.0001 | 该指标当前值。 |
DescriptionCN | string | NFSv3写延时 | 该指标中文描述。 |
DescriptionEN | string | NFSv3 write latency | 该指标英文描述。 |
Dimension结构
参数 | 类型 | 示例值 | 说明 |
---|---|---|---|
Name | string | ResourceID | 指标维度。 |
Value | string | enas-cn04*****45d06f | 该维度的值。 |
NameCN | string | 实例ID | 维度的中文名称。 |
说明
您可以忽略实际接收到的请求体中,没有提供参数说明的参数。这些参数将不会影响您获取告警通知的详细信息。
{ "Type": "Metric", "AccountId": "20******007", "RuleName": "测试告警策略", "RuleId": "1574726******98880", "Namespace": "VCM_FileNAS", "SubNamespace": "latency", "Level": "critical", "Resources": [ { "Id": "enas-cn04*****45d06f", "Name": "enas-cn04*****45d06f", "Region": "cn-north-3", "FirstAlertTime": 1664332705, "LastAlertTime": 1664332705, "Metrics": [ { "Name": "Nfsv3WriteLatency", "Unit": "ms", "Threshold": 1, "CurrentValue": 0.0001, "DescriptionCN": "NFSv3写延时", "DescriptionEN": "NFSv3 write latency" } ], "Dimensions": [ { "Name": "ResourceID", "NameCN": "实例ID", "Value": "enas-cn04*****45d06f" }, { "Name": "Node", "NameCN": "节点", "Value": "enas-cn04*****45d06f-pod-0" } ] } ] }
{ "Type": "MetricRecovered", "AccountId": "20******007", "RuleName": "测试告警策略", "RuleId": "1574726******98880", "Namespace": "VCM_FileNAS", "SubNamespace": "latency", "Level": "critical", "Resources":[], "RecoveredResources": [ { "Id": "enas-cn04*****45d08k", "Name": "enas-cn04*****45d08k", "Region": "cn-north-3", "FirstAlertTime": 1664332705, "LastAlertTime": 1664332705, "Metrics": [ { "Name": "Nfsv3WriteLatency", "Unit": "ms", "Threshold": 1, "CurrentValue": 0.5, "DescriptionCN": "NFSv3写延时", "DescriptionEN": "NFSv3 write latency" } ], "Dimensions": [ { "Name": "ResourceID", "NameCN": "实例ID", "Value": "enas-cn04*****45d06f" }, { "Name": "Node", "NameCN": "节点", "Value": "enas-cn04*****45d06f-pod-0" } ] } ] }