diff --git a/aleksis/core/settings.py b/aleksis/core/settings.py index 78c19974de7fe9c5c2beb88a91236b6884e8b519..aaec471760e5b7ee9dc7f87d46015dead229cdfd 100644 --- a/aleksis/core/settings.py +++ b/aleksis/core/settings.py @@ -858,9 +858,10 @@ SASS_PROCESSOR_STORAGE = DEFAULT_FILE_STORAGE SENTRY_ENABLED = _settings.get("health.sentry.enabled", False) if SENTRY_ENABLED: import sentry_sdk + from sentry_sdk.integrations.celery import CeleryIntegration from sentry_sdk.integrations.django import DjangoIntegration from sentry_sdk.integrations.redis import RedisIntegration - from sentry_sdk.integrations.celery import CeleryIntegration + from aleksis.core import __version__ SENTRY_SETTINGS = { @@ -877,7 +878,7 @@ if SENTRY_ENABLED: RedisIntegration(), CeleryIntegration(), ], - **SENTRY_SETTINGS + **SENTRY_SETTINGS, ) YARN_INSTALLED_APPS += [ diff --git a/aleksis/core/util/core_helpers.py b/aleksis/core/util/core_helpers.py index b9fb898abb7822684583dc2ba8ba8f6bd5b60eb0..5871fd8dd7f568d463c8f672373fa60b708caddf 100644 --- a/aleksis/core/util/core_helpers.py +++ b/aleksis/core/util/core_helpers.py @@ -219,12 +219,14 @@ def custom_information_processor(request: HttpRequest) -> dict: context["SENTRY_SETTINGS"] = settings.SENTRY_SETTINGS import sentry_sdk + span = sentry_sdk.Hub.current.scope.span if span is not None: context["SENTRY_TRACE_ID"] = span.to_traceparent() return context + def now_tomorrow() -> datetime: """Return current time tomorrow.""" return timezone.now() + timedelta(days=1)