Skip to content

Commit 09e5cce

Browse files
committed
fixes
1 parent 6888c56 commit 09e5cce

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

sentry_sdk/_span_batcher.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ def _to_transport_format(item: "StreamedSpan") -> "Any":
9191
"span_id": item.span_id,
9292
"name": item._name,
9393
"status": item._status,
94+
"start_timestamp": item._start_timestamp.timestamp(),
9495
}
9596

97+
if item._timestamp:
98+
res["end_timestamp"] = item._timestamp.timestamp()
99+
96100
if item._parent_span_id:
97101
res["parent_span_id"] = item._parent_span_id
98102

sentry_sdk/traces.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ def __init__(
418418
scope: "Optional[sentry_sdk.Scope]" = None,
419419
) -> None:
420420
self._scope = scope # type: ignore[assignment]
421+
421422
self._start()
422423

423424
def __repr__(self) -> str:
@@ -433,7 +434,7 @@ def __exit__(
433434

434435
def _start(self) -> None:
435436
if self._scope is None:
436-
return self
437+
return
437438

438439
old_span = self._scope.span
439440
self._scope.span = self

0 commit comments

Comments
 (0)