Prometheus监控学习笔记之Prometheus 2.x版本的常用变化

最近用了prometheus 2.0 版本,感觉改变还是有点大,现将改变相关记录如下:

1、prometheus.yml文件配置修改后,要想重新加载,必须在启动的时候添加参数:

      --web.enable-lifecycle  

比如:

# nohup ./prometheus --web.enable-lifecycle --config.file=prometheus.yml &

2、报警规则和记录数据规则已经不在是  rules 文件格式,完全改成了yml格式

      prometheus 提供了命令工具将原来的文件直接转换为新的格式:

# ./promtool update rules alert.rules

具体参考官方文档

https://prometheus.io/docs/prometheus/latest/migration/

原文地址:https://www.cnblogs.com/JetpropelledSnake/p/11410648.html