From 6462eea2efb1ab0a5a1b00afa24cc28051ef6850 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 2 Dec 2020 17:24:40 +0100 Subject: [PATCH] Fix sentry stdlib spam (#2326) --- supervisor/bootstrap.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/supervisor/bootstrap.py b/supervisor/bootstrap.py index 56676c7b2..f99207490 100644 --- a/supervisor/bootstrap.py +++ b/supervisor/bootstrap.py @@ -8,7 +8,11 @@ import signal from colorlog import ColoredFormatter import sentry_sdk from sentry_sdk.integrations.aiohttp import AioHttpIntegration +from sentry_sdk.integrations.atexit import AtexitIntegration +from sentry_sdk.integrations.dedupe import DedupeIntegration +from sentry_sdk.integrations.excepthook import ExcepthookIntegration from sentry_sdk.integrations.logging import LoggingIntegration +from sentry_sdk.integrations.threading import ThreadingIntegration from supervisor.jobs import JobManager @@ -295,16 +299,20 @@ def supervisor_debugger(coresys: CoreSys) -> None: def setup_diagnostics(coresys: CoreSys) -> None: """Sentry diagnostic backend.""" - sentry_logging = LoggingIntegration( - level=logging.WARNING, event_level=logging.CRITICAL - ) - _LOGGER.info("Initializing Supervisor Sentry") sentry_sdk.init( dsn="https://9c6ea70f49234442b4746e447b24747e@o427061.ingest.sentry.io/5370612", before_send=lambda event, hint: filter_data(coresys, event, hint), auto_enabling_integrations=False, - integrations=[AioHttpIntegration(), sentry_logging], + default_integrations=False, + integrations=[ + AioHttpIntegration(), + ExcepthookIntegration(), + DedupeIntegration(), + AtexitIntegration(), + ThreadingIntegration(), + LoggingIntegration(level=logging.WARNING, event_level=logging.CRITICAL), + ], release=SUPERVISOR_VERSION, max_breadcrumbs=30, )