Prometheus config 文件主要分为以下六个部分,
- global
- global 主要设置全局的变量, 例如 scrape interval (取数据 单次时间), scrape timeout (取数据请求的 timeout) 等的数据, 另外包括重新载入 rule 的时间.
- rule_files
- 规则列表
- scrape_configs:
- 采集配置, 此处支持 指定 url 采集(例如 static_configs:), 或者 服务发现采集 (service discovery 简称 sd, 例如 consul_sd_configs), 甚至从 文件发现和采集 ( file sd config),
- alerting
- 告警规则
- remote_write && romote_read
- 远程读和远程写