From 8b4eb0f10897e7361cec04b0d79fa6c86af056f2 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Tue, 25 May 2021 09:26:28 +0200 Subject: [PATCH] prometheus: enforce osd nodes in templates When osd nodes are collocated in the clients group (HCI context for instance), the current logic will exclude osd nodes since they are present in the client group. The best fix would be to exclude clients node only when they are not member of another group but for now, as a workaround, we can enforce the addition of osd nodes to fix this specific case. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1947695 Signed-off-by: Guillaume Abrioux (cherry picked from commit 664dae0564d54d6df873b96264e59fa38c8280a4) --- roles/ceph-prometheus/templates/prometheus.yml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/ceph-prometheus/templates/prometheus.yml.j2 b/roles/ceph-prometheus/templates/prometheus.yml.j2 index 28882f3db..c03b26caf 100644 --- a/roles/ceph-prometheus/templates/prometheus.yml.j2 +++ b/roles/ceph-prometheus/templates/prometheus.yml.j2 @@ -19,7 +19,7 @@ scrape_configs: {% endfor %} - job_name: 'node' static_configs: -{% for host in (groups['all'] | difference(groups[grafana_server_group_name]|union(groups.get(client_group_name, [])))) %} +{% for host in (groups['all'] | difference(groups[grafana_server_group_name] | union(groups.get(client_group_name, []))) | union(groups.get(osd_group_name, []))) %} - targets: ['{{ host }}:{{ node_exporter_port }}'] labels: instance: "{{ hostvars[host]['ansible_facts']['nodename'] }}" -- 2.39.5