2
2
scrape_interval: 60s
3
3
scrape_timeout: 10s
4
4
evaluation_interval: 15s
5
- external_labels:
6
- monitor: 'kolla'
7
5
8
6
{% if prometheus_alert_rules .files is defined and prometheus_alert_rules .files | length > 0 %}
9
7
rule_files:
@@ -17,61 +15,89 @@ scrape_configs:
17
15
static_configs:
18
16
- targets:
19
17
{% for host in groups ['prometheus' ] %}
20
- - '{{ 'api' | kolla_address( host) | put_address_in_context('url') }}:{{ prometheus_port }}'
18
+ - '{{ host }}:{{ prometheus_port }}'
21
19
{% endfor %}
20
+ relabel_configs:
21
+ - source_labels: [__address__]
22
+ regex: "([^:]+):\\d+"
23
+ target_label: instance
22
24
23
25
{% if enable_prometheus_node_exporter | bool %}
24
26
- job_name: node
25
27
static_configs:
26
28
- targets:
27
29
{% for host in groups ['prometheus-node-exporter' ] %}
28
- - '{{ 'api' | kolla_address( host) | put_address_in_context('url') }}:{{ hostvars[host] ['prometheus_node_exporter_port'] }}'
30
+ - '{{ host }}:{{ hostvars[host] ['prometheus_node_exporter_port'] }}'
29
31
{% endfor %}
32
+ relabel_configs:
33
+ - source_labels: [__address__]
34
+ regex: "([^:]+):\\d+"
35
+ target_label: instance
30
36
{% endif %}
31
37
32
38
{% if enable_prometheus_mysqld_exporter | bool %}
33
39
- job_name: mysqld
34
40
static_configs:
35
41
- targets:
36
42
{% for host in groups ['prometheus-mysqld-exporter' ] %}
37
- - '{{ 'api' | kolla_address( host) | put_address_in_context('url') }}:{{ hostvars[host] ['prometheus_mysqld_exporter_port'] }}'
43
+ - '{{ host }}:{{ hostvars[host] ['prometheus_mysqld_exporter_port'] }}'
38
44
{% endfor %}
45
+ relabel_configs:
46
+ - source_labels: [__address__]
47
+ regex: "([^:]+):\\d+"
48
+ target_label: instance
39
49
{% endif %}
40
50
41
51
{% if enable_prometheus_haproxy_exporter | bool %}
42
52
- job_name: haproxy
43
53
static_configs:
44
54
- targets:
45
55
{% for host in groups ['prometheus-haproxy-exporter' ] %}
46
- - '{{ 'api' | kolla_address( host) | put_address_in_context('url') }}:{{ hostvars[host] ['prometheus_haproxy_exporter_port'] }}'
56
+ - '{{ host }}:{{ hostvars[host] ['prometheus_haproxy_exporter_port'] }}'
47
57
{% endfor %}
58
+ relabel_configs:
59
+ - source_labels: [__address__]
60
+ regex: "([^:]+):\\d+"
61
+ target_label: instance
48
62
{% endif %}
49
63
50
64
{% if enable_prometheus_rabbitmq_exporter | bool %}
51
65
- job_name: rabbitmq
52
66
static_configs:
53
67
- targets:
54
68
{% for host in groups ['rabbitmq' ] %}
55
- - '{{ 'api' | kolla_address( host) | put_address_in_context('url') }}:{{ hostvars[host] ['prometheus_rabbitmq_exporter_port'] }}'
69
+ - '{{ host }}:{{ hostvars[host] ['prometheus_rabbitmq_exporter_port'] }}'
56
70
{% endfor %}
71
+ relabel_configs:
72
+ - source_labels: [__address__]
73
+ regex: "([^:]+):\\d+"
74
+ target_label: instance
57
75
{% endif %}
58
76
59
77
{% if enable_prometheus_memcached_exporter | bool %}
60
78
- job_name: memcached
61
79
static_configs:
62
80
- targets:
63
81
{% for host in groups ['prometheus-memcached-exporter' ] %}
64
- - '{{ 'api' | kolla_address( host) | put_address_in_context('url') }}:{{ hostvars[host] ['prometheus_memcached_exporter_port'] }}'
82
+ - '{{ host }}:{{ hostvars[host] ['prometheus_memcached_exporter_port'] }}'
65
83
{% endfor %}
84
+ relabel_configs:
85
+ - source_labels: [__address__]
86
+ regex: "([^:]+):\\d+"
87
+ target_label: instance
66
88
{% endif %}
67
89
68
90
{% if enable_prometheus_cadvisor | bool %}
69
91
- job_name: cadvisor
70
92
static_configs:
71
93
- targets:
72
94
{% for host in groups ["prometheus-cadvisor" ] %}
73
- - '{{ 'api' | kolla_address( host) | put_address_in_context('url') }}:{{ hostvars[host] ['prometheus_cadvisor_port'] }}'
95
+ - '{{ host }}:{{ hostvars[host] ['prometheus_cadvisor_port'] }}'
74
96
{% endfor %}
97
+ relabel_configs:
98
+ - source_labels: [__address__]
99
+ regex: "([^:]+):\\d+"
100
+ target_label: instance
75
101
{% endif %}
76
102
77
103
{% if enable_prometheus_ceph_mgr_exporter | bool %}
@@ -82,6 +108,10 @@ scrape_configs:
82
108
{% for exporter in prometheus_ceph_mgr_exporter_endpoints %}
83
109
- '{{ exporter }}'
84
110
{% endfor %}
111
+ relabel_configs:
112
+ - source_labels: [__address__]
113
+ regex: "([^:]+):\\d+"
114
+ target_label: instance
85
115
{% endif %}
86
116
87
117
{% if enable_prometheus_openstack_exporter | bool %}
@@ -92,8 +122,12 @@ scrape_configs:
92
122
static_configs:
93
123
- targets:
94
124
{% for host in groups ["prometheus-openstack-exporter" ] %}
95
- - '{{ 'api' | kolla_address( host) | put_address_in_context('url') }}:{{ hostvars[host] ['prometheus_openstack_exporter_port'] }}'
125
+ - '{{ host }}:{{ hostvars[host] ['prometheus_openstack_exporter_port'] }}'
96
126
{% endfor %}
127
+ relabel_configs:
128
+ - source_labels: [__address__]
129
+ regex: "([^:]+):\\d+"
130
+ target_label: instance
97
131
{% endif %}
98
132
99
133
{% if enable_prometheus_elasticsearch_exporter | bool %}
@@ -102,8 +136,12 @@ scrape_configs:
102
136
static_configs:
103
137
- targets:
104
138
{% for host in groups ["prometheus-elasticsearch-exporter" ] %}
105
- - '{{ 'api' | kolla_address( host) | put_address_in_context('url') }}:{{ hostvars[host] ['prometheus_elasticsearch_exporter_port'] }}'
139
+ - '{{ host }}:{{ hostvars[host] ['prometheus_elasticsearch_exporter_port'] }}'
106
140
{% endfor %}
141
+ relabel_configs:
142
+ - source_labels: [__address__]
143
+ regex: "([^:]+):\\d+"
144
+ target_label: instance
107
145
{% endif %}
108
146
109
147
{% if enable_prometheus_blackbox_exporter | bool and prometheus_blackbox_exporter_endpoints | length > 0 | bool %}
@@ -137,11 +175,22 @@ scrape_configs:
137
175
{% endif %}
138
176
139
177
{% if enable_prometheus_alertmanager | bool %}
178
+ - job_name: alertmanager
179
+ static_configs:
180
+ - targets:
181
+ {% for host in groups ['prometheus-alertmanager' ] %}
182
+ - '{{ host }}:{{ hostvars[host] ['prometheus_alertmanager_port'] }}'
183
+ {% endfor %}
184
+ relabel_configs:
185
+ - source_labels: [__address__]
186
+ regex: "([^:]+):\\d+"
187
+ target_label: instance
188
+
140
189
alerting:
141
190
alertmanagers:
142
191
- static_configs:
143
192
- targets:
144
193
{% for host in groups ["prometheus-alertmanager" ] %}
145
- - '{{ 'api' | kolla_address( host) | put_address_in_context('url') }}:{{ hostvars[host] ['prometheus_alertmanager_port'] }}'
194
+ - '{{ host }}:{{ hostvars[host] ['prometheus_alertmanager_port'] }}'
146
195
{% endfor %}
147
196
{% endif %}
0 commit comments