Prometheus提供服务发现功能,能够从consul、dns、kubernetes等多种来源发现目标。其中,基于文件的服务发现是Prometheus服务发现最简单的。
编写prometheus.yml
- job_name: 'pushgateway' |
创建目录
mkdir -p /etc/prometheus/conf |
写入配置文件
[root@localhost conf]# cat test.yml |
更新prometheus配置
# 检查配置 |
刷新浏览器页面,可以看到添加的标签
Prometheus提供服务发现功能,能够从consul、dns、kubernetes等多种来源发现目标。其中,基于文件的服务发现是Prometheus服务发现最简单的。
- job_name: 'pushgateway' |
mkdir -p /etc/prometheus/conf |
[root@localhost conf]# cat test.yml |
更新prometheus配置
# 检查配置 |
刷新浏览器页面,可以看到添加的标签