mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
Fail more loudly when sentry sdk experiences network troubles
This commit is contained in:
@@ -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 = {
|
||||
|
||||
13
sentry_sdk_extensions/transport.py
Normal file
13
sentry_sdk_extensions/transport.py
Normal 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)
|
||||
Reference in New Issue
Block a user