mkdir /etc/prometheus/{configs,rules} -p
vim /etc/prometheus/prometheus.yml
global:
scrape_interval: 15s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets:
- 127.0.0.1:9093
rule_files:
- "rules/*.yml"
scrape_configs:
- job_name: '卡片联邦监控'
honor_labels: true
metrics_path: '/federate'
params:
'match[]':
- '{job="国内"}'
- '{job="海外"}'
static_configs:
- targets: ['IP:9090']
- targets: ['IP:9090']
docker run --name prometheus -d -p 9090:9090 -v /etc/hosts:/etc/hosts -v /etc/prometheus/:/etc/prometheus/ prom/prometheus --web.read-timeout=5m --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheus --web.max-connections=512 --storage.tsdb.retention=30d --query.timeout=2m --web.enable-lifecycle