夜莺-Nightingale
夜莺V7
项目介绍 功能概览
部署升级 部署升级
数据接入 数据接入
告警管理 告警管理
数据查看 数据查看
功能介绍 功能介绍
API FAQ
夜莺V6
项目介绍 架构介绍
快速开始 快速开始
黄埔营
安装部署 安装部署
升级
采集器 采集器
使用手册 使用手册
API API
数据库表结构 数据库表结构
FAQ FAQ
开源生态
Prometheus
版权声明
第1章:天降奇兵 第1章:天降奇兵
第2章:探索PromQL 第2章:探索PromQL
第3章:Prometheus告警处理 第3章:Prometheus告警处理
第4章:Exporter详解 第4章:Exporter详解
第5章:数据与可视化 第5章:数据与可视化
第6章:集群与高可用 第6章:集群与高可用
第7章:Prometheus服务发现 第7章:Prometheus服务发现
第8章:监控Kubernetes 第8章:监控Kubernetes
第9章:Prometheus Operator 第9章:Prometheus Operator
参考资料

es001

Log type alert rules are very similar to conventional metric alert rules, with the only difference being how the alert conditions are set. Metric alert rules use PromQL as query conditions, while log type alert rules use Boolean expressions as query conditions. These alert conditions (such as A, B, etc.) need to be obtained through query statistics.

When configuring query statistics, you’ll notice that it is similar to an ES log query, where you first select the index, query conditions, and date fields. Additionally, there are two extra data field groups: Value Extraction and Group By.

es002

To obtain numeric results, you need to use value extraction and choose the appropriate statistical functions. In addition to common functions such as count, sum, avg, min, and max, percentile functions like p90, p95, and p99 are also supported.

Moreover, by configuring Group By, you can group the results by specific fields. This will generate multiple time series and trigger multiple alert events when the alert conditions are met.

Example 1: Alert condition for HTTP CODE 4xx

Explanation: In every 10-minute period, check the message field in the logs. If the number of 4xx logs exceeds 2, an alert will be triggered, and it will be grouped by the host.hostname field. The configuration is as follows:

es003

Example 2: Trigger alert when API response time exceeds 1 second

Explanation: Group by http_method and check if the request interface response time exceeds 1 second. The configuration is as follows:

es004

Example 3: Trigger alert when request_time exceeds 1900ms and there are more than 10 logs

Explanation: In every 2-minute period, filter logs where request_time exceeds 1900ms. Group by request_uri and check if the log count exceeds 10. The configuration is as follows:

es005

After configuring the required data fields, you can also preview the query results using the data preview button.

es006

快猫星云 联系方式 快猫星云 联系方式
快猫星云 联系方式
快猫星云 联系方式
快猫星云 联系方式
快猫星云
OpenSource
开源版
Flashcat
Flashcat