8000 Use in app filepath instead of absolute path (#2541) · davidcroda/sentry-python@044ce0a · GitHub
[go: up one dir, main page]

Skip to content

Commit 044ce0a

Browse files
authored
Use in app filepath instead of absolute path (getsentry#2541)
1 parent c025ffe commit 044ce0a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sentry_sdk/tracing_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ def add_query_source(hub, span):
238238
except Exception:
239239
filepath = None
240240
if filepath is not None:
241-
span.set_data(SPANDATA.CODE_FILEPATH, frame.f_code.co_filename)
241+
in_app_path = filepath.replace(project_root, "")
242+
span.set_data(SPANDATA.CODE_FILEPATH, in_app_path)
242243

243244
try:
244245
code_function = frame.f_code.co_name

0 commit comments

Comments
 (0)
0