Skip to content

Commit

Permalink
fix: don't send all aiokafka log.error to sentry
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kmichel-aiven committed Nov 7, 2024
1 parent ba66344 commit 0e8e831
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/karapace/sentry/sentry_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.*")

Expand Down

0 comments on commit 0e8e831

Please sign in to comment.