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