From d1513ce709726c5ca5d4c07d593198f7b4c21717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Weber?= Date: Fri, 19 Apr 2024 10:29:36 +0200 Subject: [PATCH 1/2] Do not log warnings for non-number redis metrics --- .../java/org/swisspush/gateleen/monitoring/RedisMonitor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gateleen-monitoring/src/main/java/org/swisspush/gateleen/monitoring/RedisMonitor.java b/gateleen-monitoring/src/main/java/org/swisspush/gateleen/monitoring/RedisMonitor.java index e0f8c2140..7fcc4fa21 100644 --- a/gateleen-monitoring/src/main/java/org/swisspush/gateleen/monitoring/RedisMonitor.java +++ b/gateleen-monitoring/src/main/java/org/swisspush/gateleen/monitoring/RedisMonitor.java @@ -135,7 +135,9 @@ private void collectMetrics(Buffer buffer) { publisher.publishMetric(key, value); } } catch (NumberFormatException e) { - // ignore this field + if(log.isTraceEnabled()) { + log.trace("ignore field '{}' because '{}' doesnt look number-ish enough", key, valueStr); + } } }); } From d21c504a1fb55eca0b0389f1b06612151b93072d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Weber?= Date: Fri, 19 Apr 2024 11:12:11 +0200 Subject: [PATCH 2/2] Do not log warnings for non-number redis metrics --- .../java/org/swisspush/gateleen/monitoring/RedisMonitor.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gateleen-monitoring/src/main/java/org/swisspush/gateleen/monitoring/RedisMonitor.java b/gateleen-monitoring/src/main/java/org/swisspush/gateleen/monitoring/RedisMonitor.java index 7fcc4fa21..c5e2b4e2c 100644 --- a/gateleen-monitoring/src/main/java/org/swisspush/gateleen/monitoring/RedisMonitor.java +++ b/gateleen-monitoring/src/main/java/org/swisspush/gateleen/monitoring/RedisMonitor.java @@ -135,9 +135,7 @@ private void collectMetrics(Buffer buffer) { publisher.publishMetric(key, value); } } catch (NumberFormatException e) { - if(log.isTraceEnabled()) { - log.trace("ignore field '{}' because '{}' doesnt look number-ish enough", key, valueStr); - } + log.trace("ignore field '{}' because '{}' doesnt look number-ish enough", key, valueStr); } }); }