监控与自动化:Prometheus 告警及 GitHub Actions 工作流自动化
1. Prometheus 监控与告警
在 Prometheus 中,我们可以查看服务器应用每秒的平均请求数。Prometheus 提供了强大的查询语言来分析和设置指标告警。我们可以在 Prometheus UI 中探索其功能,更多信息可参考官网文档(https://prometheus.io/docs/introduction/overview/)。
指标虽然能提供应用和基础设施行为的时间序列测量,但当测量值偏离预期时,并不会主动通知。为了应对应用的异常行为,我们需要建立正常行为规则,并在偏离时得到通知。
1.1 添加和配置 Alertmanager
我们要在 docker-compose.yaml 文件中添加 Alertmanager 服务:
version: "2"
services:
# omitted previous configurations
prometheus:
container_name: prometheus
image: prom/prometheus:latest
volumes:
- ./prometheus.yaml:/etc/prometheus/prometheus.yml
- ./rules:/etc/prometheus/rules
ports:
- "9090:9090"
alertmanager:
container_name: a
超级会员免费看
订阅专栏 解锁全文
75

被折叠的 条评论
为什么被折叠?



