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
(cherry picked from commit 15edf39469c3341a40531503fd7f7a659d77d401)
diff --git a/nova/meta/prometheus.yml b/nova/meta/prometheus.yml
index 001a9ea..1950e9b 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:
@@ -315,7 +314,7 @@
summary: "High number of errors in Nova logs"
description: "The average per-second rate of errors in Nova logs on the {{ $labels.host }} node is {{ $value }} (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: >-