下载
去官网下载已经配置好的prometheus,自行选择合适的版本安装
官网地址:https://prometheus.io/download/
解压
# tar -zxvf prometheus-2.16.0.linux-amd64.tar.gz
配置文件
其中prometheus.yml为配置文件,配置文件是 yaml 格式的,分为 global、alerting、rule_files 和 scrape_configs 四部分:
- global :全局参数配置
- alerting :告警服务地址
- rule_files :告警和记录规则
- scrape_configs :数据采集地址
其中 rule_files 和 scrape_configs 是重点,后者支持多种动态发现方式,更复杂一些。