diff --git a/src/pve_exporter/collector/cluster.py b/src/pve_exporter/collector/cluster.py index 849adfb..9cbbc18 100644 --- a/src/pve_exporter/collector/cluster.py +++ b/src/pve_exporter/collector/cluster.py @@ -209,7 +209,7 @@ def collect(self): # pylint: disable=missing-docstring 'guest': GaugeMetricFamily( 'pve_guest_info', 'VM/CT info', - labels=['id', 'node', 'name', 'type']), + labels=['id', 'node', 'name', 'type', 'template']), 'storage': GaugeMetricFamily( 'pve_storage_info', 'Storage info', @@ -218,11 +218,11 @@ def collect(self): # pylint: disable=missing-docstring info_lookup = { 'lxc': { - 'labels': ['id', 'node', 'name', 'type'], + 'labels': ['id', 'node', 'name', 'type', 'template'], 'gauge': info_metrics['guest'], }, 'qemu': { - 'labels': ['id', 'node', 'name', 'type'], + 'labels': ['id', 'node', 'name', 'type', 'template'], 'gauge': info_metrics['guest'], }, 'storage': { @@ -235,7 +235,7 @@ def collect(self): # pylint: disable=missing-docstring restype = resource['type'] if restype in info_lookup: - label_values = [resource.get(key, '') for key in info_lookup[restype]['labels']] + label_values = [str(resource.get(key, '')) for key in info_lookup[restype]['labels']] info_lookup[restype]['gauge'].add_metric(label_values, 1) label_values = [resource['id']]