From: Atul Agarwal Date: Mon, 18 Oct 2021 06:44:06 +0000 (+0000) Subject: Resolved 1698 - MON fails to collect metrics from an OpenStack VIM with metrics suppo... X-Git-Tag: v9.1.5 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=d569c288484ba8524b8b785d3afe1f5938959416;p=osm%2FMON.git Resolved 1698 - MON fails to collect metrics from an OpenStack VIM with metrics support if there is another OpenStack VIM without metrics support registered Change-Id: Id1be735511cc16fc1a44629acbb54b6e9c0efd0f Signed-off-by: Atul Agarwal --- diff --git a/osm_mon/collector/service.py b/osm_mon/collector/service.py index 5eb65a9..b99a5d8 100644 --- a/osm_mon/collector/service.py +++ b/osm_mon/collector/service.py @@ -27,6 +27,7 @@ import logging from typing import List import concurrent.futures import time +import keystoneauth1.exceptions from osm_mon.collector.infra_collectors.onos import OnosInfraCollector from osm_mon.collector.infra_collectors.openstack import OpenstackInfraCollector @@ -176,10 +177,14 @@ class CollectorService: # Wait for future calls to complete till process_execution_timeout. Default is 50 seconds for future in concurrent.futures.as_completed(futures, self.conf.get('collector', 'process_execution_timeout')): - result = future.result(timeout=int(self.conf.get('collector', - 'process_execution_timeout'))) - metrics.extend(result) - log.debug('result = %s' % (result)) + try: + result = future.result(timeout=int(self.conf.get('collector', + 'process_execution_timeout'))) + metrics.extend(result) + log.debug('result = %s' % (result)) + except keystoneauth1.exceptions.connection.ConnectionError as e: + log.info("Keystone connection error during metric collection") + log.debug("Keystone connection error exception %s" % (e)) except concurrent.futures.TimeoutError as e: # Some processes have not completed due to timeout error log.info('Some processes have not finished due to TimeoutError exception')