loki 是一個很不錯的類似prometheus 的日志系統,我們也可以基於grafana 進行報警添加
當然新版本也支持類似alertmanager 模式的報警(后期試用添加說明)
原理
將loki 數據添加為prometheus 格式的,然后基於prometheus 的模式進行報警(因為loki 支持prrometheus 格式的查詢,同時是proxy模式的)
參考配置
- loki 數據源
- 添加dashboard
loki 查詢
- 添加報警
說明
loki 也支持類似prometheus alertmanager 格式的報警,后邊寫一些文章
參考資料
https://grafana.com/docs/loki/latest/logql/
https://grafana.com/docs/loki/latest/overview/
https://grafana.com/docs/loki/latest/api/
https://grafana.com/docs/loki/latest/alerting/