File tree Expand file tree Collapse file tree 3 files changed +9
-26
lines changed
tests/integrations/rust_tracing Expand file tree Collapse file tree 3 files changed +9
-26
lines changed Original file line number Diff line number Diff line change @@ -698,21 +698,21 @@ def transaction(self):
698698 return None
699699
700700 # there is an orphan span on the scope
701- if self ._span .containing_transaction is None :
701+ if self ._span .root_span is None :
702702 return None
703- # there is either a transaction (which is its own containing
704- # transaction ) or a non-orphan span on the scope
705- return self ._span .containing_transaction
703+ # there is either a root span (which is its own root
704+ # span ) or a non-orphan span on the scope
705+ return self ._span .root_span
706706
707707 def set_transaction_name (self , name , source = None ):
708708 # type: (str, Optional[str]) -> None
709709 """Set the transaction name and optionally the transaction source."""
710710 self ._transaction = name
711711
712- if self ._span and self ._span .containing_transaction :
713- self ._span .containing_transaction .name = name
712+ if self ._span and self ._span .root_span :
713+ self ._span .root_span .name = name
714714 if source :
715- self ._span .containing_transaction .source = source
715+ self ._span .root_span .source = source
716716
717717 if source :
718718 self ._transaction_info ["source" ] = source
Original file line number Diff line number Diff line change 11from datetime import datetime
22from enum import Enum
33import json
4- import warnings
54
65from opentelemetry import trace as otel_trace , context
76from opentelemetry .trace import (
@@ -139,7 +138,7 @@ def __repr__(self):
139138 return "<%s>" % self .__class__ .__name__
140139
141140 @property
142- def containing_transaction (self ):
141+ def root_span (self ):
143142 # type: () -> Optional[Span]
144143 return None
145144
@@ -385,22 +384,6 @@ def origin(self, value):
385384
386385 self .set_attribute (SentrySpanAttribute .ORIGIN , value )
387386
388- @property
389- def containing_transaction (self ):
390- # type: () -> Optional[Span]
391- """
392- Get the transaction this span is a child of.
393-
394- .. deprecated:: 3.0.0
395- This will be removed in the future. Use :func:`root_span` instead.
396- """
397- warnings .warn (
398- "Deprecated: This will be removed in the future. Use root_span instead." ,
399- DeprecationWarning ,
400- stacklevel = 2 ,
401- )
402- return self .root_span
403-
404387 @property
405388 def root_span (self ):
406389 # type: () -> Optional[Span]
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ def test_on_new_span_without_transaction(sentry_init):
189189 rust_tracing .new_span (RustTracingLevel .Info , 3 )
190190 current_span = sentry_sdk .get_current_span ()
191191 assert current_span is not None
192- assert current_span .containing_transaction is None
192+ assert current_span .root_span is None
193193
194194
195195def test_on_event_exception (sentry_init , capture_events ):
You can’t perform that action at this time.
0 commit comments