Skip to content

Commit

Permalink
add project_root to debug_meta in event
Browse files Browse the repository at this point in the history
  • Loading branch information
lobsterkatie committed Jan 17, 2025
1 parent 4ed8992 commit be54163
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sentry_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,12 +474,13 @@ def _prepare_event(
scope, # type: Optional[Scope]
):
# type: (...) -> Optional[Event]
is_transaction = event.get("type") == "transaction"
is_checkin = event.get("type") == "check_in"

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

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

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

if not is_transaction and not is_checkin:
event.setdefault("debug_meta", {}).update(
{"project_root": self.options["project_root"]}
)

event = handle_in_app(
event,
self.options["in_app_exclude"],
Expand Down

0 comments on commit be54163

Please sign in to comment.