天天看点

pmm 自定义prometheus 配置 - 荣锋亮

pmm 自定义prometheus 配置

pmm 基于ansible自动生成运行的配置文件,我们可以基于pmm 定义好的一个基础配置提供自定义配置的扩展

配置目录说明

/srv/prometheus/prometheus.base.yml      

参考配置

---      
remote_write:      
 - url: http://1.2.3.4:8428/api/v1/write      
scrape_configs:      
 - job_name: victoria-metrics      
   honor_timestamps: true      
   scrape_interval: 5s      
   scrape_timeout: 4s      
   metrics_path: /metrics      
   scheme: http      
   static_configs:      
     - targets:      
         - "1.2.3.4:8428"      
       labels:      
         instance: pmm-server      

配置说明

global 会保留, scrape_configs 以及 rule_files 被合并, alerting, remote_write, 以及 remote_read 设置同样被保留

参考资料

https://www.percona.com/blog/2020/03/23/extending-pmm-prometheus-configuration/