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

UpdateAlertRule

最近更新时间2023.05.17 16:30:46

首次发布时间2022.08.05 11:06:59

调用UpdateAlertRule接口修改报警规则的详细信息。

请求方式

使用POST方式发起请求。

请求参数

下表仅列出了接口特有的请求参数和部分公共参数。完整的公共参数列表,参考公共参数

字段

位置

类型

必填

说明

示例值

Action

Query

String

公共参数,OpenAPI接口名称。

UpdateAlertRule

Version

Query

String

公共参数,OpenAPI接口版本。

2022-07-11

Id

RequestBody

Int64

报警配置ID。

-

Config

RequsetBody

AlertRuleConfig

报警配置。

-

AlertRuleConfig

字段

类型

说明

Name

String

报警名称。

Desc

String

报警描述。

AlertStrategy

AlertStrategy

报警策略。

NotifyConfig

NotifyConfig

报警通知配置。

NotifyConfig

字段

类型

说明

NotifyInterval

Int32

通知间隔。

NotifyTypes

Array[String]

报警类型。

  • email
  • lark

NotifyLarkWebhooks

Array[String]

飞书Webhook列表。

NotifyWebhooks

Array[String]

CommonWebhook列表。

NotifyGroup

Array[Int32]

报警组ID。

AlertStrategy

字段

类型

说明

AlertType

String

报警类型。

  • host
  • process
  • container
  • custom_metric

AlertLevel

Array[String]

报警等级。

LogicOperator

String

多策略关系。

  • and
  • or

ExecuteInterval

Int32

报警执行间隔。单位:分钟。

MetricConfig

Array[AlertMetricConfig]

指标策略。

AlertMetricConfig

字段

类型

说明

ScanWindow

Int32

检测时间窗口。单位:分钟。

RollupTimeframeByAggregator

String

时间窗口聚合方式。

  • AVG
  • SUM
  • LAST
  • COUNT
  • MAX
  • MIN

AlertMetric

AlertMetric

报警执行间隔。单位:分钟。

CompareConfigList

Map[AlertCompareConfig]

指标策略。

  • Notice
  • Warn
  • Fatal

AlertCompareConfig

字段

类型

说明

CompareType

String

  • thershold:阈值
  • window:比较

CompareOp

String

阈值:

  • >
  • <
  • <=
  • >=
  • =
    比较:
  • increase
  • increase_percent
  • decrease
  • decrease_percent
  • abs
  • abs_percent

Level

String

报警等级与MapKey相同。

WindowSize

Int3

数据采样窗口长度。单位为秒。

Value

Float64

阈值。

AlertMetric

字段

类型

说明

IsFormula

Boolean

是否为复合报警。

SimpleMetric

AlertSimpleMetric

简单报警指标。当IsFormula=true时,为空。

FormulaMetric

AlertFormulaMetric

复合报警指标。当IsFormula=false时,为空。

AlertFormulaMetric

字段

类型

说明

AlertSimpleMetric

Array[AlertSimpleMetric]

简单报警指标。

FormulaQuery

FormulaQuery

复合指标配置。

FormulaQuery

字段

类型

说明

Formula

String

复合指标计算公式。

Alias

String

展示名称。

Unit

String

单位。

Alphabet

String

计算公式使用的符号。

AlertSimpleMetric

字段

类型

说明

Ispromql

Boolean

是否为PromQL指标。

Promql

String

promsql查询。

Metric

String

指标名称。

Unit

String

单位。

Alphabet

String

计算复合指标公式使用的符号

MetricCategory

String

Metric类型。

  • host
  • process
  • container
  • custom_metric

MetricSource

String

指标类型。

  • prometheus
  • influxdb

GroupByFields

Array[String]

分组。

Aggregator

String

分组聚合函数。

AddFunc

String

后处理函数。

  • diff
  • per_second_rate
  • per_minute_rate
  • per_second
  • per_minute

Filters

Array[FilterCondition]

过滤条件。

FilterCondition

字段

类型

说明

Key

String

过滤tag名称。

Op

String

过滤运算符。

  • <
  • >
  • =
  • <=
  • >=

Values

String

单位。

返回参数

Result字段包含以下参数:

字段

类型

说明

Id

Int32

报警组ID。

请求示例

POST https://open.volcengineapi.com?Action=UpdateAlertRule&Version=2022-07-11
&<公共请求参数>

返回示例

{
    "ResponseMetadata": {
        "RequestId": "",
        "Action": "UpdateAlertRule",
        "Version": "2022-07-11",
        "Service": "apmplus_server",
        "Region": "cn-beijing"
    },
    "Result": {
        "Id":1
    }
}