Collect libvirt metrics only for libvirt compute driver
Some drivers like ironic, vmware and others will not require libvirt is
running on local compute.
This patch updates prometheus.yml metadata to configure libivirt metrics
collection only when compute_driver == libvirt.LibvirtDriver
Change-Id: I3a10e985afbbea826043d9ae341f298fe8402136
Related-Prod: PROD-25643
diff --git a/nova/meta/prometheus.yml b/nova/meta/prometheus.yml
index fbebd2d..f3e12ee 100644
--- a/nova/meta/prometheus.yml
+++ b/nova/meta/prometheus.yml
@@ -4,8 +4,7 @@
{%- set is_compute = compute.get('enabled', False) %}
{%- if is_controller or is_compute %}
-{%- if is_compute and
- exporters is defined %}
+{%- if is_compute and exporters is defined and compute.get('compute_driver', 'libvirt.LibvirtDriver') == 'libvirt.LibvirtDriver' %}
{%- set packages = exporters.get('libvirt', {}).get('packages', ('libvirt-exporter', )) %}
{%- load_yaml as new_exporters_cfg %}
exporters:
@@ -157,7 +156,7 @@
summary: "High number of errors in Nova logs"
description: "The average rate of errors in Nova logs on the {{ $labels.host }} node is more than 0.2 error messages per second (as measured over the last 5 minutes)."
{%- endraw %}
-{%- if is_compute and exporters is defined %}
+{%- if is_compute and exporters is defined and compute.get('compute_driver', 'libvirt.LibvirtDriver') == 'libvirt.LibvirtDriver'%}
{%- raw %}
LibvirtDown:
if: >-