# my global config global: scrape_interval:15s# Set the scrape interval to every 15 seconds. Default is every 1 minute. evaluation_interval:15s# Evaluate rules every 15 seconds. The default is every 1 minute. # scrape_timeout is set to the global default (10s).
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. rule_files: -"rules/*.yml"
# A scrape configuration containing exactly one endpoint to scrape: # Here it's Prometheus itself. scrape_configs: # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. -job_name:"prometheus" static_configs: -targets: ["localhost:9090"] # 这里添加了keepalived_exporter的配置。 -job_name:"node_exporter-Template" consul_sd_configs: -server:'192.168.0.250:8500' services: [] relabel_configs: -source_labels: [__meta_consul_tags] # 这里通过tag来进行分组,按照不同组展示不同的任务 regex:.*node.* action:keep -source_lables: [__meta_consul_service] # 这里将consul中的meta相关的key-value自定义标签信息保存为lable供告警等做选择项 regex:__meta_consul_service_metadata_(.*) replacement:consul_$1 action:labelmap
修改了配置文件,使用下面命令热加载配置文件。
1
[root@prometheus ~]# curl -X POST http://192.168.0.254:9090/-/reload