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:
Raphael Michel
2024-06-10 16:25:08 +02:00
committed by GitHub
parent 8bc16af36e
commit ab576bb643
3 changed files with 14 additions and 60 deletions
+13 -1
View File
@@ -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
)