+ value = self.backend.collect_metric(
+ metric_type, openstack_metric_name, resource_id
+ )
+
+ if value is None and metric_name in METRIC_MAPPINGS_FOR_ROCKY_AND_NEWER_RELEASES:
+ # Reattempting metric collection with new metric names.
+ # Some metric names have changed in newer Openstack releases
+ log.info(
+ "Reattempting metric collection for type: %s and name: %s and resource_id %s",
+ metric_type,
+ metric_name,
+ resource_id
+ )
+ openstack_metric_name = METRIC_MAPPINGS_FOR_ROCKY_AND_NEWER_RELEASES[metric_name]
+ value = self.backend.collect_metric(
+ metric_type, openstack_metric_name, resource_id
+ )