最近用了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/