diff options
| author | Zuul <zuul@review.opendev.org> | 2024-03-06 12:27:58 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2024-03-06 12:27:58 +0000 |
| commit | a7dd2425ec198392a5dc18e14db815580d70aeb2 (patch) | |
| tree | 1c8b57332c82987c2ec402ea946c21aeb110552f /ansible | |
| parent | add83518345a8621031feb3e14a35902f96672ce (diff) | |
| parent | 10f0e9ddef68b1ba607a462650d07147d1fd6b19 (diff) | |
| download | kolla-ansible-a7dd2425ec198392a5dc18e14db815580d70aeb2.tar.gz kolla-ansible-a7dd2425ec198392a5dc18e14db815580d70aeb2.zip | |
Merge "prometheus: Add friendly instance labels for ironic and alertmanager"
Diffstat (limited to 'ansible')
| -rw-r--r-- | ansible/roles/prometheus/templates/prometheus.yml.j2 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ansible/roles/prometheus/templates/prometheus.yml.j2 b/ansible/roles/prometheus/templates/prometheus.yml.j2 index 9cb76ab4b..e56bb19ab 100644 --- a/ansible/roles/prometheus/templates/prometheus.yml.j2 +++ b/ansible/roles/prometheus/templates/prometheus.yml.j2 @@ -226,6 +226,10 @@ scrape_configs: static_configs: {% for host in groups['ironic-conductor'] %} - targets: ["{{ 'api' | kolla_address(host) | put_address_in_context('url') }}:{{ hostvars[host]['ironic_prometheus_exporter_port'] }}"] +{% if hostvars[host].prometheus_instance_label | default(false, true) %} + labels: + instance: "{{ hostvars[host].prometheus_instance_label }}" +{% endif %} {% endfor %} {% endif %} @@ -247,5 +251,9 @@ alerting: - targets: {% for host in groups["prometheus-alertmanager"] %} - '{{ 'api' | kolla_address(host) | put_address_in_context('url') }}:{{ hostvars[host]['prometheus_alertmanager_port'] }}' +{% if hostvars[host].prometheus_instance_label | default(false, true) %} + labels: + instance: "{{ hostvars[host].prometheus_instance_label }}" +{% endif %} {% endfor %} {% endif %} |
