Skip to content

Commit ec53eb0

Browse files
jovialJohnGarbutt
andcommitted
Switch prometheus to active/passive mode
This uses the same approach as the mariadb role (and others). Closes-Bug: : 1928193 Co-Authored-By: John Garbutt <[email protected]> Change-Id: I79a7a8c80327cfd9ef31d17fe71f450a181a638c (cherry picked from commit 502152290ac5fc2a09176c52a459b9741273b752) (cherry picked from commit 9ec49a3)
1 parent d896b8c commit ec53eb0

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

ansible/roles/prometheus/defaults/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ prometheus_services:
1313
mode: "http"
1414
external: false
1515
port: "{{ prometheus_port }}"
16+
custom_member_list: "{{ prometheus_haproxy_members.split(';') }}"
1617
prometheus-node-exporter:
1718
container_name: prometheus_node_exporter
1819
group: prometheus-node-exporter
@@ -105,6 +106,11 @@ prometheus_services:
105106
####################
106107
prometheus_mysql_exporter_database_user: "{% if use_preconfigured_databases | bool and use_common_mariadb_user | bool %}{{ database_user }}{% else %}prometheus{% endif %}"
107108

109+
####################
110+
# HAProxy
111+
####################
112+
prometheus_haproxy_members: "{% for host in groups['prometheus'] %}server {{ hostvars[host]['ansible_hostname'] }} {{ 'api' | kolla_address(host) }}:{{ prometheus_port }} check inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}"
113+
108114
####################
109115
# Blackbox
110116
####################
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
upgrade:
3+
- |
4+
Prometheus has been switched to active/passive mode. See bug `1928193
5+
<https://bugs.launchpad.net/kolla-ansible/+bug/1928193>`__.
6+
fixes:
7+
- |
8+
Fixes an issue with misaligned data points in grafana when loadbalancing
9+
over multiple prometheus server instances. See bug `1928193
10+
<https://bugs.launchpad.net/kolla-ansible/+bug/1928193>`__.

0 commit comments

Comments
 (0)