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 提供了命令工具将原来的文件直接转换为新的格式:

   [root@localhost prometheus-2.0.0.linux-amd64]# ./promtool update rules rules/alert.rules

具体参考官方文档

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

扫描二维码关注公众号,回复: 432612 查看本文章

猜你喜欢

转载自yjph83.iteye.com/blog/2399820