From a809f25f674a75fbe94673b0b497ae7c44214e08 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Wed, 29 Nov 2023 08:57:01 +0100 Subject: [PATCH] Use in app filepath instead of absolute path --- sentry_sdk/tracing_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sentry_sdk/tracing_utils.py b/sentry_sdk/tracing_utils.py index 1beb48b538..0407b84f47 100644 --- a/sentry_sdk/tracing_utils.py +++ b/sentry_sdk/tracing_utils.py @@ -238,7 +238,8 @@ def add_query_source(hub, span): except Exception: filepath = None if filepath is not None: - span.set_data(SPANDATA.CODE_FILEPATH, frame.f_code.co_filename) + in_app_path = filepath.replace(project_root, "") + span.set_data(SPANDATA.CODE_FILEPATH, in_app_path) try: code_function = frame.f_code.co_name