File tree 3 files changed +9
-26
lines changed
tests/integrations/rust_tracing
3 files changed +9
-26
lines changed Original file line number Diff line number Diff line change @@ -698,21 +698,21 @@ def transaction(self):
698
698
return None
699
699
700
700
# there is an orphan span on the scope
701
- if self ._span .containing_transaction is None :
701
+ if self ._span .root_span is None :
702
702
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
706
706
707
707
def set_transaction_name (self , name , source = None ):
708
708
# type: (str, Optional[str]) -> None
709
709
"""Set the transaction name and optionally the transaction source."""
710
710
self ._transaction = name
711
711
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
714
714
if source :
715
- self ._span .containing_transaction .source = source
715
+ self ._span .root_span .source = source
716
716
717
717
if source :
718
718
self ._transaction_info ["source" ] = source
Original file line number Diff line number Diff line change 1
1
from datetime import datetime
2
2
from enum import Enum
3
3
import json
4
- import warnings
5
4
6
5
from opentelemetry import trace as otel_trace , context
7
6
from opentelemetry .trace import (
@@ -139,7 +138,7 @@ def __repr__(self):
139
138
return "<%s>" % self .__class__ .__name__
140
139
141
140
@property
142
- def containing_transaction (self ):
141
+ def root_span (self ):
143
142
# type: () -> Optional[Span]
144
143
return None
145
144
@@ -385,22 +384,6 @@ def origin(self, value):
385
384
386
385
self .set_attribute (SentrySpanAttribute .ORIGIN , value )
387
386
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
-
404
387
@property
405
388
def root_span (self ):
406
389
# 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):
189
189
rust_tracing .new_span (RustTracingLevel .Info , 3 )
190
190
current_span = sentry_sdk .get_current_span ()
191
191
assert current_span is not None
192
- assert current_span .containing_transaction is None
192
+ assert current_span .root_span is None
193
193
194
194
195
195
def test_on_event_exception (sentry_init , capture_events ):
You can’t perform that action at this time.
0 commit comments