From 62c471c358615f0964794e999a0dcb90fe7535a5 Mon Sep 17 00:00:00 2001 From: Mingjie Shao Date: Tue, 30 Jul 2024 18:52:12 +0100 Subject: [PATCH] Logging stacktrace for the exception if MetricValidation failed for each retry (#135) This change logs stacktrace of the failed attempt in warning level, so operator will see the missing metric even after one retry. --- validator/src/main/java/com/amazon/aoc/helpers/RetryHelper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/validator/src/main/java/com/amazon/aoc/helpers/RetryHelper.java b/validator/src/main/java/com/amazon/aoc/helpers/RetryHelper.java index 27bcd257b..e07eec081 100644 --- a/validator/src/main/java/com/amazon/aoc/helpers/RetryHelper.java +++ b/validator/src/main/java/com/amazon/aoc/helpers/RetryHelper.java @@ -42,6 +42,7 @@ public static boolean retry( return true; } catch (Exception ex) { exceptionInTheEnd = ex; + log.warn(ex); if (retryCount != 0) { // don't sleep before leave this loop log.info( "retrying after {} seconds", TimeUnit.MILLISECONDS.toSeconds(sleepInMilliSeconds));