Fail more loudly when sentry sdk experiences network troubles

This commit is contained in:
Klaas van Schelven
2024-05-24 14:47:31 +02:00
parent 4c48376b5f
commit a6123e22ac
2 changed files with 15 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ from debug_toolbar.middleware import show_toolbar
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk_extensions.transport import MoreLoudlyFailingTransport
SECRET_KEY = 'django-insecure-$@clhhieazwnxnha-_zah&(bieq%yux7#^07&xsvhn58t)8@xw'
@@ -64,6 +65,7 @@ if SENTRY_DSN is not None:
auto_session_tracking=False,
traces_sample_rate=0,
send_default_pii=True,
transport=MoreLoudlyFailingTransport,
)
SNAPPEA = {

View File

@@ -0,0 +1,13 @@
import logging
from sentry_sdk.transport import HttpTransport
# the lazy choice: I've already got loggers set up for bugsink; I'll just use them. Better would be: just use "sentry"
logger = logging.getLogger("bugsink.sentry")
class MoreLoudlyFailingTransport(HttpTransport):
def on_dropped_event(self, reason):
# type: (str) -> None
# ... do you thing ...
logger.error("Sentry SDK dropped event: %s", reason)