# cat prometheus/prometheus-consul.yml
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Defaul t is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is eve ry 1 minute.
# scrape_timeout is set to the global default (10s).
external_labels:
region: 'HeFei'
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
- 10.251.23xxxx:9093
scrape_configs:
- job_name: 'consul-node'
consul_sd_configs:
- server: '10.251.:8500'
services: ['node_exporter']
refresh_interval: 3s
relabel_configs:
- regex: __meta_consul_service_(.+)
action: labelmap
- source_labels: ['__meta_consul_tags']
regex: ',(?:[^,]+,){0}([^=]+)=([^,]+),.*'
replacement: '${2}'
target_label: '${1}'
- source_labels: ['__meta_consul_tags']
regex: ',(?:[^,]+,){1}([^=]+)=([^,]+),.*'
replacement: '${2}'
target_label: '${1}'
- source_labels: ['__meta_consul_tags']
regex: ',(?:[^,]+,){2}([^=]+)=([^,]+),.*'
replacement: '${2}'
target_label: '${1}'
- job_name: blackbox
metrics_path: /probe
params:
module: [http_2xx] # Look for a HTTP 200 response.
static_configs:
- targets:
- http://10.251.20xxx:9180 # Target to probe with https.
- http://10.251.20xxx:9181 # Target to probe with https.
labels:
app: esi
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 10.251.23.1xxx:9115
- job_name: cadvisor
static_configs:
- targets: ['10.251.23.130:8080']
labels:
instance: cadvisor