Bump sentry-sdk to 1.15.*

This commit is contained in:
Raphael Michel
2023-02-22 12:58:37 +01:00
parent 04899c9540
commit 0bb99c911b
2 changed files with 1 additions and 41 deletions

View File

@@ -22,14 +22,10 @@
import re
import weakref
from collections import OrderedDict
from functools import wraps
from celery.exceptions import Retry
from django.dispatch import Signal
from sentry_sdk import Hub
from sentry_sdk.consts import OP
from sentry_sdk.integrations import django as djangosentry
from sentry_sdk.integrations.django.signals_handlers import _get_receiver_name
from sentry_sdk.utils import capture_internal_exceptions
MASK = '*' * 8
@@ -47,37 +43,6 @@ KEYS = frozenset([
VALUES_RE = re.compile(r'^(?:\d[ -]*?){13,16}$')
def patched_patch_signals():
# This is a workaround for https://github.com/getsentry/sentry-python/issues/1700
# that needs to stay until it is fixed
old_live_receivers = Signal._live_receivers
def _sentry_live_receivers(self, sender):
hub = Hub.current
receivers = old_live_receivers(self, sender)
def sentry_receiver_wrapper(receiver):
@wraps(receiver)
def wrapper(*args, **kwargs):
signal_name = _get_receiver_name(receiver)
with hub.start_span(
op=OP.EVENT_DJANGO,
description=signal_name,
) as span:
span.set_data("signal", signal_name)
return receiver(*args, **kwargs)
return wrapper
for idx, receiver in enumerate(receivers):
receivers[idx] = sentry_receiver_wrapper(receiver)
return receivers
Signal._live_receivers = _sentry_live_receivers
def scrub_data(data):
if isinstance(data, dict):
for k, v in data.items():
@@ -149,11 +114,6 @@ class PretixSentryIntegration(djangosentry.DjangoIntegration):
@staticmethod
def setup_once():
# This is a workaround for https://github.com/getsentry/sentry-python/issues/1700
# that needs to stay until it is fixed
djangosentry.patch_signals = patched_patch_signals
djangosentry.signals_handlers.patch_signals = patched_patch_signals
djangosentry.DjangoIntegration.setup_once()
from django.core.handlers.base import BaseHandler