You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# 全局配置部分
global :
# 默认情况下, 每15秒抓取一次目标数据
scrape_interval : 15s
# 抓取配置部分,包含所有需要抓取的端点配置
# 这里首先配置了Prometheus自身的监控
scrape_configs :
# 作业名称会作为标签`job=<job_name>`添加到从该配置抓取的所有时间序列中
- job_name : 'prometheus'
# 覆盖全局默认配置, 从该作业抓取目标的间隔为5秒
scrape_interval : 5s
# 静态配置的目标列表(不需要服务发现)
static_configs :
# 监控Prometheus自身, 默认运行在localhost:9090
- targets : [ 'localhost:9090' ]
# 配置Pushgateway的监控抓取
- job_name : 'pushgateway'
# 抓取间隔设置为1秒( 更频繁地获取推送的数据)
scrape_interval : 1s
# Pushgateway的静态目标配置
static_configs :
# Pushgateway服务地址( 假设通过容器网络访问, 服务名为pushgateway, 端口9091)
- targets : [ 'pushgateway:9091' ]
# 保留被推送数据中原有的标签( 不覆盖job等标签)
# 对于Pushgateway尤为重要, 因为它需要保留推送数据的原始标签信息
honor_labels : true
# 远程写入配置( 将Prometheus收集的数据推送到其他服务)
remote_write :
# 配置推送到Grafana的Prometheus兼容端点
# 假设Grafana服务通过容器网络访问, 服务名为grafana, 端口3000
- url : http://grafana:3000/api/prom/push