diff --git a/backend/src/appointment/main.py b/backend/src/appointment/main.py index 621ec623a..c4279b55d 100644 --- a/backend/src/appointment/main.py +++ b/backend/src/appointment/main.py @@ -85,7 +85,7 @@ def _common_setup(): profile_traces_max = 0.25 sample_rate = 1.0 elif environment == APP_ENV_PROD: - profile_traces_max = 0.50 + profile_traces_max = 0.66 sample_rate = 1.0 def traces_sampler(sampling_context): @@ -110,6 +110,7 @@ def traces_sampler(sampling_context): ], profiles_sampler=traces_sampler, traces_sampler=traces_sampler, + attach_stacktrace=True, ) diff --git a/backend/src/appointment/routes/caldav.py b/backend/src/appointment/routes/caldav.py index cbef344cc..41e98088f 100644 --- a/backend/src/appointment/routes/caldav.py +++ b/backend/src/appointment/routes/caldav.py @@ -45,8 +45,11 @@ def caldav_autodiscover_auth( 'url': lookup_url, 'branch': 'CACHE' } - debug_exc = UnexpectedBehaviourWarning(message='Cache incorrect', info=debug_obj) - sentry_sdk.capture_exception(debug_exc) + # Raise and catch the unexpected behaviour warning so we can get proper stacktrace in sentry... + try: + raise UnexpectedBehaviourWarning(message='Cache incorrect', info=debug_obj) + except UnexpectedBehaviourWarning as ex: + sentry_sdk.capture_exception(ex) # Ignore cached result and look it up again lookup_url = None @@ -77,8 +80,11 @@ def caldav_autodiscover_auth( 'url': lookup_url, 'branch': lookup_branch } - debug_exc = UnexpectedBehaviourWarning(message='Invalid caldav url', info=debug_obj) - sentry_sdk.capture_exception(debug_exc) + # Raise and catch the unexpected behaviour warning so we can get proper stacktrace in sentry... + try: + raise UnexpectedBehaviourWarning(message='Invalid caldav url', info=debug_obj) + except UnexpectedBehaviourWarning as ex: + sentry_sdk.capture_exception(ex) # Finally perform any final fixups needed connection.url = Tools.fix_caldav_urls(connection.url) diff --git a/backend/src/appointment/routes/schedule.py b/backend/src/appointment/routes/schedule.py index 52887ab2f..f61298502 100644 --- a/backend/src/appointment/routes/schedule.py +++ b/backend/src/appointment/routes/schedule.py @@ -278,8 +278,11 @@ def request_schedule_availability_slot( 'submitter_timezone': s_a.attendee.timezone, 'owner_timezone': subscriber.timezone, } - debug_exc = UnexpectedBehaviourWarning(message='Invalid booking time warning!', info=debug_obj) - sentry_sdk.capture_exception(debug_exc) + # Raise and catch the unexpected behaviour warning so we can get proper stacktrace in sentry... + try: + raise UnexpectedBehaviourWarning(message='Invalid booking time warning!', info=debug_obj) + except UnexpectedBehaviourWarning as ex: + sentry_sdk.capture_exception(ex) raise validation.SlotNotFoundException()