From 5e1198877328ed29a72e67c585825f8362b4d862 Mon Sep 17 00:00:00 2001 From: wahidw Date: Wed, 12 Jan 2022 06:18:20 +0000 Subject: [PATCH] Changing log severity level in case of liveness/readiness issues Signed-off-by: wahidw Change-Id: I649dd94059263244645e7a8236ad058c3f0df55d --- a1/a1rmr.py | 1 - a1/controller.py | 5 +++-- a1/data.py | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/a1/a1rmr.py b/a1/a1rmr.py index e4a7448..049ea2f 100644 --- a/a1/a1rmr.py +++ b/a1/a1rmr.py @@ -276,7 +276,6 @@ class _RmrLoop: # we must free each sbuf rmr.rmr_free_msg(sbuf) - self.last_ran = time.time() time.sleep(1) diff --git a/a1/controller.py b/a1/controller.py index 49f7d24..19b8a26 100644 --- a/a1/controller.py +++ b/a1/controller.py @@ -27,6 +27,7 @@ from a1 import a1rmr, exceptions, data mdc_logger = Logger(name=__name__) +mdc_logger.mdclog_format_init(configmap_monitor=True) a1_counters = Counter('A1Policy', 'Policy type and instance counters', ['counter']) @@ -76,10 +77,10 @@ def get_healthcheck(): 3. checks that our SDL connection is healthy """ if not a1rmr.healthcheck_rmr_thread(): - mdc_logger.debug("A1 is not healthy due to the rmr thread") + mdc_logger.error("A1 is not healthy due to the rmr thread") return "rmr thread is unhealthy", 500 if not data.SDL.healthcheck(): - mdc_logger.debug("A1 is not healthy because it does not have a connection to SDL") + mdc_logger.error("A1 is not healthy because it does not have a connection to SDL") return "sdl connection is unhealthy", 500 return "", 200 diff --git a/a1/data.py b/a1/data.py index 436912f..8ec30cc 100644 --- a/a1/data.py +++ b/a1/data.py @@ -37,6 +37,7 @@ HANDLER_PREFIX = "a1.policy_handler." mdc_logger = Logger(name=__name__) +mdc_logger.mdclog_format_init(configmap_monitor=True) if USE_FAKE_SDL: mdc_logger.debug("Using fake SDL") SDL = SDLWrapper(use_fake_sdl=USE_FAKE_SDL) -- 2.16.6