Skip to content

Commit be54163

Browse files
committed
add project_root to debug_meta in event
1 parent 4ed8992 commit be54163

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sentry_sdk/client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,12 +474,13 @@ def _prepare_event(
474474
scope, # type: Optional[Scope]
475475
):
476476
# type: (...) -> Optional[Event]
477+
is_transaction = event.get("type") == "transaction"
478+
is_checkin = event.get("type") == "check_in"
477479

478480
if event.get("timestamp") is None:
479481
event["timestamp"] = datetime.now(timezone.utc)
480482

481483
if scope is not None:
482-
is_transaction = event.get("type") == "transaction"
483484
spans_before = len(event.get("spans", []))
484485
event_ = scope.apply_to_event(event, hint, self.options)
485486

@@ -541,6 +542,11 @@ def _prepare_event(
541542
if event.get("platform") is None:
542543
event["platform"] = "python"
543544

545+
if not is_transaction and not is_checkin:
546+
event.setdefault("debug_meta", {}).update(
547+
{"project_root": self.options["project_root"]}
548+
)
549+
544550
event = handle_in_app(
545551
event,
546552
self.options["in_app_exclude"],

0 commit comments

Comments
 (0)