1. prometheus-主配置文件详解
-
主机配置文件详解
[root@iZj6cbgktk3zjpge312vq2Z prometheus]# cat prometheus.yml # my global config # 全局配置 global: scrape_interval: 15s # 采集数据时间间隔 evaluation_interval: 15s # 每15秒评估规则。默认为1分钟。 scrape_timeout: 5s # 采集数据超时时间,默认10秒 # scrape_timeout is set to the global default (10s). # Alertmanager configuration 告警配置 alerting: alertmanagers: - static_configs: - targets: # - alertmanager:9093 # Load rules once and periodically evaluate them according to the global 'evaluation_interval'. rule_files: # - "first_rules.yml" # - "second_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' # metrics_path defaults to '/metrics' # scheme defaults to 'http'. static_configs: - targets: ['localhost:9090']
global:全局配置 scrape_interval: 15s # 采集数据时间间隔 evaluation_interval: 15s # 评估告警规则时间间隔,默认1分钟 scrape_timeout:5s # 采集数据超时时间,默认10秒 rule_files:告警规则 scrape_configs:配置被监控端,称为target,每个target用job_name分组管理,又分为静态配置和服务发现 alerting:告警配置 remote_write/remote_read:从远程数据库读写
-
配置文件