Merge "Put openstack exporter behind HAproxy so only one is queried at a time"

This commit is contained in:
Zuul 2022-05-13 09:48:56 +00:00 committed by Gerrit Code Review
commit dd7e10e194
3 changed files with 21 additions and 3 deletions

View File

@ -79,6 +79,12 @@ prometheus_services:
image: "{{ prometheus_openstack_exporter_image_full }}"
volumes: "{{ prometheus_openstack_exporter_default_volumes + prometheus_openstack_exporter_extra_volumes }}"
dimensions: "{{ prometheus_openstack_exporter_dimensions }}"
haproxy:
prometheus_openstack_exporter:
enabled: "{{ enable_prometheus_openstack_exporter | bool }}"
mode: "http"
external: false
port: "{{ prometheus_openstack_exporter_port }}"
prometheus-elasticsearch-exporter:
container_name: prometheus_elasticsearch_exporter
group: prometheus-elasticsearch-exporter

View File

@ -100,9 +100,7 @@ scrape_configs:
honor_labels: true
static_configs:
- targets:
{% for host in groups["prometheus-openstack-exporter"] %}
- '{{ 'api' | kolla_address(host) | put_address_in_context('url') }}:{{ hostvars[host]['prometheus_openstack_exporter_port'] }}'
{% endfor %}
- '{{ kolla_internal_vip_address | put_address_in_context('url') }}:{{ prometheus_openstack_exporter_port }}'
{% endif %}
{% if enable_prometheus_elasticsearch_exporter | bool %}

View File

@ -0,0 +1,14 @@
---
fixes:
- |
The prometheus openstack exporters are now behind haproxy,
providing a unique time series in the prometheus database.
Also ensures that only one exporter queries
the openstack APIs at any given time interval.
With the previous behavior each openstack exporter
was scraped at the same time.
This caused each exporter to query the openstack APIs
simultaneously introducing unneccesary load and duplicate
time series in the prometheus database due to the instance
label being unique for each exporter.
`LP#1972818 <https://bugs.launchpad.net/kolla-ansible/+bug/1972818>`__