prometheus 文件配置小技巧优化

2023-05-16

一、前言

很久没看过监控,直到公司机器越来越多,项目越来越多,prometheus.yml 文件一直在增加显得很杂乱无章,这里优化了根据项目文件来改配置文件。

二、优化

1、prometheus.yml 文件里

 - job_name: 'jd-test'
    file_sd_configs:
      - files: ['/usr/local/prometheus/sd_config/test/host.yml']
        refresh_interval: 30s

2、添加 sd_config 文件

vim /usr/local/prometheus/sd_config/test/host.yml
- targets:
  - 192.168.1.3:9100
  - 192.168.1.4:9100
  - 192.168.1.5:9100

3、重启一下 Prometheus即可

三、总结

很简单的小问题,记录一下

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

prometheus 文件配置小技巧优化 的相关文章

随机推荐