From 725d15173e83d39d12a14c4d811deed45c48dd3c Mon Sep 17 00:00:00 2001 From: Matt Anson Date: Fri, 24 Jan 2025 12:28:13 +0000 Subject: [PATCH] Fix IPv6 addresses for prometheus exporters Ensure that IPv6 listen addresses for libvirt-exporter and fluentd prometheus exporter are formatted correctly by passing them through put_address_in_context as with other prometheus exporters. Closes-Bug: #2096659 Change-Id: Ib035534e2d1a27d5f496cfc6fa1d24a3dbe1dd41 --- .../common/templates/conf/input/08-prometheus.conf.j2 | 2 +- .../templates/prometheus-libvirt-exporter.json.j2 | 2 +- .../notes/promethus-exporters-ipv6-c87b57cd21cb6bfe.yaml | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/promethus-exporters-ipv6-c87b57cd21cb6bfe.yaml diff --git a/ansible/roles/common/templates/conf/input/08-prometheus.conf.j2 b/ansible/roles/common/templates/conf/input/08-prometheus.conf.j2 index 1aa5da895e..10b35ed3e7 100644 --- a/ansible/roles/common/templates/conf/input/08-prometheus.conf.j2 +++ b/ansible/roles/common/templates/conf/input/08-prometheus.conf.j2 @@ -1,6 +1,6 @@ @type prometheus - bind {{ api_interface_address }} + bind "{{ api_interface_address | put_address_in_context('url') }}" port {{ prometheus_fluentd_integration_port }} metrics_path /metrics diff --git a/ansible/roles/prometheus/templates/prometheus-libvirt-exporter.json.j2 b/ansible/roles/prometheus/templates/prometheus-libvirt-exporter.json.j2 index ca67b6a422..47bf22571a 100644 --- a/ansible/roles/prometheus/templates/prometheus-libvirt-exporter.json.j2 +++ b/ansible/roles/prometheus/templates/prometheus-libvirt-exporter.json.j2 @@ -1,5 +1,5 @@ { - "command": "/opt/libvirt-exporter --web.listen-address={{ api_interface_address }}:{{ prometheus_libvirt_exporter_port }}", + "command": "/opt/libvirt-exporter --web.listen-address={{ api_interface_address | put_address_in_context('url') }}:{{ prometheus_libvirt_exporter_port }}", "config_files": [ {% if kolla_copy_ca_into_containers | bool %} { diff --git a/releasenotes/notes/promethus-exporters-ipv6-c87b57cd21cb6bfe.yaml b/releasenotes/notes/promethus-exporters-ipv6-c87b57cd21cb6bfe.yaml new file mode 100644 index 0000000000..2221663bbf --- /dev/null +++ b/releasenotes/notes/promethus-exporters-ipv6-c87b57cd21cb6bfe.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Correctly formats prometheus-libvirt-exporter and + Fluentd Prometheus exporter IPv6 listen addresses. + + Fixes `LP#2096659 + `__