Skip to content

Commit 8f89066

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 635bcae commit 8f89066

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
@@ -15,6 +15,7 @@ prometheus_services:
1515
mode: "http"
1616
external: false
1717
port: "{{ prometheus_port }}"
18+
custom_member_list: "{{ prometheus_haproxy_members.split(';') }}"
1819
prometheus-node-exporter:
1920
container_name: prometheus_node_exporter
2021
group: prometheus-node-exporter
@@ -107,6 +108,11 @@ prometheus_services:
107108
####################
108109
prometheus_mysql_exporter_database_user: "{% if use_preconfigured_databases | bool and use_common_mariadb_user | bool %}{{ database_user }}{% else %}prometheus{% endif %}"
109110

111+
####################
112+
# HAProxy
113+
####################
114+
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 %}"
115+
110116
####################
111117
# Blackbox
112118
####################
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)