Skip to content

Commit ea928bd

Browse files
feat: Remove early return for NoOpStreamedSpan in set_transaction_name() (#7164)
Ensure that the transaction name and source are set on the scope when the trace is not sampled, so that they are still applied to error events. This aligns the streaming trace lifecycle with the transaction-based lifecycle.
1 parent 264addc commit ea928bd

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

sentry_sdk/scope.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -861,10 +861,7 @@ def set_transaction_name(self, name: str, source: "Optional[str]" = None) -> Non
861861
"""Set the transaction name and optionally the transaction source."""
862862
self._transaction = name
863863
if self._span:
864-
if isinstance(self._span, NoOpStreamedSpan):
865-
return
866-
867-
elif isinstance(self._span, StreamedSpan):
864+
if isinstance(self._span, StreamedSpan):
868865
self._span._segment.name = name
869866
if source:
870867
self._span._segment.set_attribute(

0 commit comments

Comments
 (0)