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

Integrating Loki Data Source

In Data Source Management —> Click “Add” in the upper right corner —> Select Loki

l01

Fill in the relevant information as required. If the Loki service is not configured with multi-tenant mode, you don’t need to fill in the Header and Value below. The tenant ID can be obtained from the Loki administrator.

l02

How to confirm if multi-tenant mode is enabled? It’s simple—just make a request to the service without a tenant ID, and you can tell by the response. If you receive a “no org id” message, it means a tenant ID is required, as shown below.

l03

If you receive a normal response, then no tenant ID is required, as shown below.

l04

Querying Data

Scenario 1: Query each log line with a 401 status {container="evaluate-loki-flog-1"} | json | status="401"

l05

Scenario 2: Query the number of logs with a 401 status code in the last 5 minutes count_over_time({container="evaluate-loki-flog-1"} |= "401" [5m])

l06

Configuring Alerts

Alert Scenario: Trigger an alert if the number of logs with a 401 status code in the last 5 minutes is greater than 0

This alert scenario can be flexibly adjusted, such as replacing it with the number of occurrences of the keyword ERROR or any specific error code.

Select the Loki alert source in the alert configuration and configure the alert expression.

l07

After configuration, you can view the alert details in the alert history.

l08

Troubleshooting

If the alert configuration does not trigger as expected, you can check DEBUG.log to find related errors. You can search for the keywords “rule_eval” and “alert ID.”

l09

开源版
Flashcat
Flashduty