vdur['name'], vnf_member_index, nsr_id)
continue
try:
+ log.info("Collecting metric type: %s and metric_name: %s and resource_id %s and "
+ "interface_name: %s", metric_type, metric_name, resource_id, interface_name)
value = self.backend.collect_metric(metric_type, openstack_metric_name, resource_id,
interface_name)
if value is not None:
+ log.info("value: %s", value)
if interface_name:
tags['interface'] = interface_name
metric = VnfMetric(nsr_id, vnf_member_index, vdur['name'], metric_name, value, tags)
metrics.append(metric)
- except Exception:
+ else:
+ log.info("metric value is empty")
+ except Exception as e:
log.exception("Error collecting metric %s for vdu %s" % (metric_name, vdur['name']))
+ log.info("Error in metric collection: %s" % e)
return metrics
def _get_backend(self, vim_account: dict):
try:
ceilometer = CeilometerBackend(vim_account)
ceilometer.client.capabilities.get()
+ log.info("Using ceilometer backend to collect metric")
return ceilometer
except (HTTPException, EndpointNotFound):
gnocchi = GnocchiBackend(vim_account)
gnocchi.client.metric.list(limit=1)
+ log.info("Using gnocchi backend to collect metric")
return gnocchi
def _get_metric_type(self, metric_name: str, interface_name: str) -> MetricType: