Merge "prometheus: Add friendly instance labels for ironic and alertmanager"

This commit is contained in:
Zuul 2024-03-06 12:27:58 +00:00 committed by Gerrit Code Review
commit a7dd2425ec
2 changed files with 14 additions and 0 deletions

View File

@ -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 %}

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Adds missing support for friendly labels for Prometheus Ironic exporter and
Alertmanager metrics. `LP#2041855
<https://bugs.launchpad.net/kolla-ansible/+bug/2041855>`__