Commit 8b4eb0f1 authored by Guillaume Abrioux's avatar Guillaume Abrioux
Browse files

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: default avatarGuillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 664dae05)
parent 0eed8589
...@@ -19,7 +19,7 @@ scrape_configs: ...@@ -19,7 +19,7 @@ scrape_configs:
{% endfor %} {% endfor %}
- job_name: 'node' - job_name: 'node'
static_configs: 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 }}'] - targets: ['{{ host }}:{{ node_exporter_port }}']
labels: labels:
instance: "{{ hostvars[host]['ansible_facts']['nodename'] }}" instance: "{{ hostvars[host]['ansible_facts']['nodename'] }}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment