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

FlatAlertHistoryList

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

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

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

请求方式

使用POST方式发起请求。

请求参数

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

字段

位置

类型

必填

说明

示例值

Action

Query

String

公共参数,OpenAPI接口名称。

FlatAlertHistoryList

Version

Query

String

公共参数,OpenAPI接口版本。

2022-07-11

StartTime

RequestBody

Int64

开始时间。

-

EndTime

RequestBody

Int64

结束时间。

-

OrderBy

RequestBody

String

顺序。

  • asc
  • desc

-

AlertType

RequestBody

String

报警类型。

  • host
  • process
  • container
  • custom_metric:可以为空。

-

Keyword

RequestBody

String

搜索关键字

-

RuleIds

RequestBody

Array[Int64]

报警策略ID列表。

-

PageNo

RequestBody

Int32

分页编号。

-

PageSize

RequestBody

Int32

分页长度。

-

返回参数

Result字段包含以下参数:

字段

类型

说明

Total

Int32

列表长度。

Data

Array[FlatAlertHistoryItem]

报警详情。

FlatAlertHistoryItem

字段

类型

说明

Id

Int32

历史ID。

RuleId

Int32

报警策略ID。

Name

Int32

报警策略名称。

Level

Int32

报警等级。

AlertTime

Int32

报警时间。

AlertStrategy

AlertStrategy

报警策略。

NotifyConfig

NotifyConfig

报警通知配置。

RuleCheckResult

RuleCheckResult

报警查询结果。

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

报警类型。

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]

指标策略。

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

计算公式使用的符号。

RuleCheckResult

字段

类型

说明

IsAlert

Boolean

复合指标计算公式。

NoDataAlert

Boolean

无数据报警。

Level

String

报警登记。

Alphabet

String

计算公式使用的符号

AlertStrategy

AlertStrategy

报警策略。

RelatedAlertMetricResult

Array[MetricCheckResult]

关联报警指标

MetricCheckResult

字段

类型

说明

IsAlert

Boolean

复合指标计算公式。

Level

String

报警登记。

AlertMetric

AlertMetricConfig

报警策略。

RelatedValues

Array[GroupValue]

关联报警指标。

GroupValue

字段

类型

说明

Tags

Array[Tags]

标签。

AlertValue

float64

报警值。

CurValue

float64

当前值。

PreValue

float64

前值。

DeltaRatio

float64

变化值。

DeltaAbsolute

float64

变化率

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=FlatAlertHistoryList&Version=2022-07-11
&<公共请求参数>

返回示例

{
    "ResponseMetadata": {
        "RequestId": "",
        "Action": "FlatAlertHistoryList",
        "Version": "2022-07-11",
        "Service": "apmplus_server",
        "Region": "cn-beijing"
    },
    "Result": {
        "Data": [
            {
                "AlertStrategy": {
                    "AlertLevel": [
                        "Fatal"
                    ],
                    "AlertSphere": {
                        "IsAgg": false,
                        "ServiceApis": [],
                        "ServiceNames": [
                            "server_trace_panic"
                        ],
                        "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": "\u003e",
                                    "CompareType": "threshold",
                                    "Level": "Fatal",
                                    "Value": 2,
                                    "WindowSize": 60
                                },
                                "Notice": {
                                    "CompareOp": "\u003e",
                                    "CompareType": "threshold",
                                    "Level": "Notice",
                                    "Value": 0,
                                    "WindowSize": 60
                                },
                                "Warn": {
                                    "CompareOp": "\u003e",
                                    "CompareType": "threshold",
                                    "Level": "Warn",
                                    "Value": 0,
                                    "WindowSize": 60
                                }
                            },
                            "Id": "8168465247-1658074826937",
                            "RollupTimeframeByAggregator": "SUM",
                            "ScanWindow": 5
                        }
                    ],
                    "NoDataNotify": false,
                    "NoDataNotifyThreshold": 10,
                    "ServiceNames": [
                        "server_trace_panic"
                    ],
                    "WatchdogEvents": [
                        {
                            "Category": "host",
                            "CategoryLabel": "主机监控",
                            "EventName": "cpu_used_ratio_overtop",
                            "EventNameLabel": "CPU使用率过高",
                            "Filters": []
                        }
                    ]
                },
                "AlertTime": "1658133720",
                "Id": "566776",
                "Level": "Fatal",
                "Name": "testwjx",
                "NotifyConfig": {
                    "NotifyGroup": [
                        137
                    ],
                    "NotifyInterval": 120,
                    "NotifyTypes": [
                        "email"
                    ]
                },
                "RuleCheckResult": {
                    "AlertStrategy": {
                        "AlertLevel": null,
                        "AlertType": "",
                        "ExecuteInterval": 0,
                        "GroupAlert": false,
                        "LogicOperator": "",
                        "MetricConfig": null,
                        "NoDataNotify": false,
                        "NoDataNotifyThreshold": 0,
                        "ServiceNames": null
                    },
                    "IsAlert": true,
                    "Level": "Fatal",
                    "NoDataAlert": false,
                    "RelatedAlertMetricResult": [
                        {
                            "AlertMetric": {
                                "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": "\u003e",
                                        "CompareType": "threshold",
                                        "Level": "Fatal",
                                        "Value": 2,
                                        "WindowSize": 60
                                    },
                                    "Notice": {
                                        "CompareOp": "\u003e",
                                        "CompareType": "threshold",
                                        "Level": "Notice",
                                        "Value": 0,
                                        "WindowSize": 60
                                    },
                                    "Warn": {
                                        "CompareOp": "\u003e",
                                        "CompareType": "threshold",
                                        "Level": "Warn",
                                        "Value": 0,
                                        "WindowSize": 60
                                    }
                                },
                                "Id": "8168465247-1658074826937",
                                "RollupTimeframeByAggregator": "SUM",
                                "ScanWindow": 5
                            },
                            "IsAlert": true,
                            "Level": "Fatal",
                            "RelatedValues": [
                                {
                                    "AlertValue": 51,
                                    "CurValue": 51,
                                    "DeltaAbsolute": 51,
                                    "DeltaRatio": 1,
                                    "PreValue": 0,
                                    "Tags": null
                                }
                            ]
                        }
                    ],
                    "RelatedAlertWatchdogResult": null
                },
                "RuleId": 251,
                "Status": {
                    "AckUntilTime": "1658075004",
                    "InAck": false,
                    "IsNotified": true,
                    "IsUpgraded": false,
                    "NoNotifyReason": "",
                    "NoNotifyReasonDesc": ""
                }
            }
        ],
        "Total": 30
    }
}