mirror of
https://github.com/pretix/pretix.git
synced 2026-08-27 13:24:41 +00:00
Update sentry-sdk requirement from ==1.45.* to ==2.5.* (#4176)
* Update sentry-sdk requirement from ==1.45.* to ==2.3.* * Review notes
This commit is contained in:
+13
-1
@@ -629,15 +629,21 @@ LOGGING = {
|
||||
|
||||
SENTRY_ENABLED = False
|
||||
if config.has_option('sentry', 'dsn') and not any(c in sys.argv for c in ('shell', 'shell_scoped', 'shell_plus')):
|
||||
import django.db.models.signals
|
||||
import sentry_sdk
|
||||
from sentry_sdk.integrations.celery import CeleryIntegration
|
||||
from sentry_sdk.integrations.logging import (
|
||||
LoggingIntegration, ignore_logger,
|
||||
)
|
||||
from sentry_sdk.scrubber import EventScrubber, DEFAULT_DENYLIST
|
||||
|
||||
from .sentry import PretixSentryIntegration, setup_custom_filters
|
||||
|
||||
SENTRY_TOKEN = config.get('sentry', 'traces_sample_token', fallback='')
|
||||
pretix_denylist = DEFAULT_DENYLIST + [
|
||||
"access_token",
|
||||
"sentry_dsn",
|
||||
]
|
||||
|
||||
def traces_sampler(sampling_context):
|
||||
qs = sampling_context.get('wsgi_environ', {}).get('QUERY_STRING', '')
|
||||
@@ -649,7 +655,12 @@ if config.has_option('sentry', 'dsn') and not any(c in sys.argv for c in ('shell
|
||||
sentry_sdk.init(
|
||||
dsn=config.get('sentry', 'dsn'),
|
||||
integrations=[
|
||||
PretixSentryIntegration(),
|
||||
PretixSentryIntegration(
|
||||
signals_denylist=[
|
||||
django.db.models.signals.pre_init,
|
||||
django.db.models.signals.post_init,
|
||||
]
|
||||
),
|
||||
CeleryIntegration(),
|
||||
LoggingIntegration(
|
||||
level=logging.INFO,
|
||||
@@ -659,6 +670,7 @@ if config.has_option('sentry', 'dsn') and not any(c in sys.argv for c in ('shell
|
||||
traces_sampler=traces_sampler,
|
||||
environment=urlparse(SITE_URL).netloc,
|
||||
release=__version__,
|
||||
event_scrubber=EventScrubber(denylist=pretix_denylist, recursive=True),
|
||||
send_default_pii=False,
|
||||
propagate_traces=False, # see https://github.com/getsentry/sentry-python/issues/1717
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user