commit b3618d641a385f5fc5b7f32141ec64373bba16e8 Author: asarfaty Date: Tue Oct 13 13:37:35 2020 +0200 Add logging for octavia stats collector Change-Id: I64736b3347d050f4c1a542a3fb15efb2cf2f1e0c diff --git a/vmware_nsx/services/lbaas/octavia/octavia_listener.py b/vmware_nsx/services/lbaas/octavia/octavia_listener.py index a55b3d3..fb9754d 100644 --- a/vmware_nsx/services/lbaas/octavia/octavia_listener.py +++ b/vmware_nsx/services/lbaas/octavia/octavia_listener.py @@ -677,6 +677,8 @@ class NSXOctaviaListenerEndpoint(object): class NSXOctaviaStatisticsCollector(object): def __init__(self, core_plugin, listener_stats_getter, loadbalancer_status_getter=None): + LOG.info("NSXOctaviaStatisticsCollector starting with interval of " + "%s seconds", cfg.CONF.octavia_stats_interval) self.core_plugin = core_plugin self.listener_stats_getter = listener_stats_getter self.loadbalancer_status_getter = loadbalancer_status_getter @@ -685,12 +687,18 @@ class NSXOctaviaStatisticsCollector(object): cfg.CONF.octavia_stats_interval) def thread_runner(self, interval): + LOG.info("NSXOctaviaStatisticsCollector thread_runner is running") while True: time.sleep(interval) - self.collect() + try: + self.collect() + except Exception as e: + LOG.error("Octavia stats collect failed with %s", e) def collect(self): if not self.core_plugin.octavia_listener: + LOG.warning("Octavia stats collector cannot run with plugin %s", + self.core_plugin) return endpoint = self.core_plugin.octavia_listener.endpoints[0]