From: Benjamin Diaz Date: Tue, 4 Jun 2019 12:55:50 +0000 (-0300) Subject: Adds network interface name as tag in corresponding metric X-Git-Tag: v6.0.0~5 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=00fa694ed15ffb9f34874abb7aa3a5b39e12dfc1;p=osm%2FMON.git Adds network interface name as tag in corresponding metric Change-Id: I5c02d9a0582113319936772bd456b347828f7443 Signed-off-by: Benjamin Diaz --- diff --git a/osm_mon/collector/vnf_collectors/openstack.py b/osm_mon/collector/vnf_collectors/openstack.py index f32fb9d..0eaa1b9 100644 --- a/osm_mon/collector/vnf_collectors/openstack.py +++ b/osm_mon/collector/vnf_collectors/openstack.py @@ -117,7 +117,10 @@ class OpenstackCollector(BaseVimCollector): value = self.backend.collect_metric(metric_type, openstack_metric_name, resource_id, interface_name) if value is not None: - metric = VnfMetric(nsr_id, vnf_member_index, vdur['name'], metric_name, value) + tags = {} + 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: log.exception("Error collecting metric %s for vdu %s" % (metric_name, vdur['name']))