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

GetAlertRuleDetail

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

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

调用GetAlertRuleDetail接口查询报警详情接口的详细信息。

请求方式

使用POST方式发起请求。

请求参数

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

字段

位置

类型

必填

说明

示例值

Action

Query

String

公共参数,OpenAPI接口名称。

GetAlertRuleDetail

Version

Query

String

公共参数,OpenAPI接口版本。

2022-07-11

Id

RequestBody

Int64

报警配置ID。

-

返回参数

Result字段包含以下参数:

字段

类型

说明

Id

Int32

公共参数,OpenAPI接口名称。

Config

AlertRuleConfig

报警配置。

Status

AlertRuleStatus

报警状态。

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]

指标策略。

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时,为空。

AlertSimpleMetric

字段

类型

说明

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

单位。

AlertRuleStatus

字段

类型

说明

CreateBy

User

报警创建用户。

UpdateBy

User

最近修改用户。

CreateAt

Int64

创建时间。

UpdateAt

Int64

最近修改时间。

AlertCount

Int64

报警次数。

LastMonthAlertCount

Int64

上月报警次数

LastExecuteTime

Int64

上次报警时间。

NextTriggerTime

Int64

下次执行时间。

EnableStatus

Boolean

是否开启。

AlertStatus

Boolean

是否删除

InAck

Boolean

是否Ackownledge。

AckUntilTime

int64

Ack直到。

请求示例

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

返回示例

{
    "ResponseMetadata": {
        "Action": "GetAlertRuleDetail",
        "Region": "cn-beijing",
        "RequestId": "",
        "Service": "apmplus_server",
        "Version": "2022-07-11"
    },
    "Result": {
        "Config": {
            "AlertStrategy": {
                "AlertLevel": [
                    "Fatal"
                ],
                "AlertSphere": {
                    "IsAgg": false,
                    "ServiceApis": [],
                    "ServiceNames": [
                        "server_trace_error"
                    ],
                    "SphereType": "service"
                },
                "AlertType": "service",
                "ExecuteInterval": 120,
                "GroupAlert": false,
                "LogicOperator": "and",
                "MetricConfig": [
                    {
                        "AlertMetric": {
                            "FormulaMetric": {
                                "AlertSimpleMetric": [
                                    {
                                        "Aggregator": "AVG",
                                        "Alphabet": "a",
                                        "Filters": [
                                            {
                                                "Key": "",
                                                "Op": "in",
                                                "Values": []
                                            }
                                        ],
                                        "GroupByFields": [],
                                        "Ispromql": false,
                                        "Metric": "",
                                        "MetricCategory": "",
                                        "MetricLabel": "",
                                        "MetricSource": "",
                                        "MetricType": "",
                                        "Unit": ""
                                    }
                                ],
                                "FormulaQuery": {
                                    "Alias": "",
                                    "Alphabet": "",
                                    "Formula": "",
                                    "Hide": false,
                                    "Id": "",
                                    "Unit": ""
                                }
                            },
                            "IsFormula": false,
                            "SimpleMetric": {
                                "Aggregator": "AVG",
                                "Alphabet": "a",
                                "Filters": [
                                    {
                                        "Key": "",
                                        "Op": "in",
                                        "Values": []
                                    }
                                ],
                                "GroupByFields": [],
                                "Ispromql": false,
                                "Metric": "apminsight.service.log.error",
                                "MetricCategory": "service",
                                "MetricLabel": "错误日志数",
                                "MetricSource": "influxdb",
                                "MetricType": "",
                                "Unit": ""
                            }
                        },
                        "CompareConfigList": {
                            "Fatal": {
                                "CompareOp": "",
                                "CompareType": "threshold",
                                "Level": "Fatal",
                                "Value": 3,
                                "WindowSize": 60
                            },
                            "Notice": {
                                "CompareOp": "",
                                "CompareType": "threshold",
                                "Level": "Notice",
                                "Value": 0,
                                "WindowSize": 60
                            },
                            "Warn": {
                                "CompareOp": "",
                                "CompareType": "threshold",
                                "Level": "Warn",
                                "Value": 0,
                                "WindowSize": 60
                            }
                        },
                        "Id": "8979402427-1655877919010",
                        "RollupTimeframeByAggregator": "SUM",
                        "ScanWindow": 5
                    }
                ],
                "NoDataNotify": false,
                "NoDataNotifyThreshold": 10,
                "ServiceNames": [
                    "server_trace_panic"
                ],
                "WatchdogEvents": [
                    {
                        "Category": "host",
                        "CategoryLabel": "主机监控",
                        "EventName": "cpu_used_ratio_overtop",
                        "EventNameLabel": "CPU使用率过高",
                        "Filters": []
                    }
                ]
            },
            "CreateFrom": "",
            "Desc": "",
            "Name": "gyf_test error_log1",
            "NotifyConfig": {
                "NotifyGroup": [
                    93
                ],
                "NotifyInterval": 86400,
                "NotifyTypes": [
                    "email"
                ]
            }
        },
        "Id": 241,
        "Status": {
            "AckUntilTime": "1655877953",
            "AlertCount": "12119",
            "AlertStatus": true,
            "CreateAt": "1655877953",
            "CreateBy": {
                "AvatarUrl": "",
                "Email": "",
                "Name": "bytedance-apm"
            },
            "EnableStatus": true,
            "InAck": false,
            "LastExecuteTime": "1657801440",
            "LastMonthAlertCount": "0",
            "LastTrigerTime": "0",
            "NextTriggerTime": "1657801560",
            "UpdateAt": "1657800066",
            "UpdateBy": {
                "AvatarUrl": "",
                "Email": "",
                "Name": "bytedance-apm"
            }
        }
    }
}