-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprometheus.yml
41 lines (37 loc) · 1.16 KB
/
prometheus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# my global config
global:
scrape_interval: 15s
evaluation_interval: 30s
# scrape_timeout is set to the global default (10s).
external_labels:
monitor: codelab
rule_files:
- "first.rules"
- "/absolute/second.rules"
- "my/*.rules"
scrape_configs:
- job_name: prometheus
honor_labels: true
target_groups:
- targets: ['localhost:9090']
- job_name: consul_services
consul_sd_configs:
- server: 'consul:8500'
relabel_configs:
# Ignore target services unless they are tagged in Consul with 'metrics'.
- source_labels: ['__meta_consul_tags']
regex: 'metrics,|,metrics,|,metrics'
action: keep
# Relable the __address__ label of the service to use the service address and
# port from Consul. By default, Prometheus will just assume the Consul agent IP
# is correct.
- source_labels: ['__meta_consul_service_address', '__meta_consul_service_port']
separator: ':'
regex: '(.*)'
target_label: '__address__'
replacement: '$1'
# Relabel 'job' to match the name of the service in Consul.
- source_labels: ['__meta_consul_service']
regex: '(.*)'
target_label: 'job'
replacement: '$1'