From 0e8e831da788bd14e23bd0c9e87b2395f966aeb2 Mon Sep 17 00:00:00 2001 From: Kevin Michel Date: Thu, 7 Nov 2024 01:39:57 +0100 Subject: [PATCH] fix: don't send all aiokafka log.error to sentry These log events are numerous and costly. When these `log.error` events are related to real error, they cause exceptions which are still properly handled and recorded by Sentry, no need to also send individual events for all the `log.error` in addition to the exceptions. The same logic was already applied for the `kafka` library. --- src/karapace/sentry/sentry_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/karapace/sentry/sentry_client.py b/src/karapace/sentry/sentry_client.py index 776214c7f..c4dc99d33 100644 --- a/src/karapace/sentry/sentry_client.py +++ b/src/karapace/sentry/sentry_client.py @@ -41,6 +41,8 @@ def _initialize_sentry(self) -> None: # Don't send library logged errors to Sentry as there is also proper return value or raised exception to calling code from sentry_sdk.integrations.logging import ignore_logger + ignore_logger("aiokafka") + ignore_logger("aiokafka.*") ignore_logger("kafka") ignore_logger("kafka.*")