2626 SENTRY_TRACE_HEADER_NAME ,
2727 NoOpSpan ,
2828 Span ,
29- POTelSpan ,
30- Transaction ,
3129)
3230from sentry_sdk .utils import (
3331 capture_internal_exception ,
@@ -677,7 +675,7 @@ def clear(self):
677675 self .clear_breadcrumbs ()
678676 self ._should_capture = True # type: bool
679677
680- self ._span = None # type: Optional[POTelSpan ]
678+ self ._span = None # type: Optional[Span ]
681679 self ._session = None # type: Optional[Session]
682680 self ._force_auto_session_tracking = None # type: Optional[bool]
683681
@@ -707,7 +705,7 @@ def fingerprint(self, value):
707705 @property
708706 def transaction (self ):
709707 # type: () -> Any
710- # would be type: () -> Optional[Transaction ], see https://github.com/python/mypy/issues/3004
708+ # would be type: () -> Optional[Span ], see https://github.com/python/mypy/issues/3004
711709 """Return the transaction (root span) in the scope, if any."""
712710
713711 # there is no span/transaction on the scope
@@ -734,7 +732,7 @@ def transaction(self, value):
734732 # anything set in the scope.
735733 # XXX: note that with the introduction of the Scope.transaction getter,
736734 # there is a semantic and type mismatch between getter and setter. The
737- # getter returns a Transaction , the setter sets a transaction name.
735+ # getter returns a Span , the setter sets a transaction name.
738736 # Without breaking version compatibility, we could make the setter set a
739737 # transaction name or transaction (self._span) depending on the type of
740738 # the value argument.
@@ -785,13 +783,13 @@ def set_user(self, value):
785783
786784 @property
787785 def span (self ):
788- # type: () -> Optional[POTelSpan ]
786+ # type: () -> Optional[Span ]
789787 """Get current tracing span."""
790788 return self ._span
791789
792790 @span .setter
793791 def span (self , span ):
794- # type: (Optional[POTelSpan ]) -> None
792+ # type: (Optional[Span ]) -> None
795793 """Set current tracing span."""
796794 self ._span = span
797795
@@ -952,7 +950,7 @@ def add_breadcrumb(self, crumb=None, hint=None, **kwargs):
952950 self ._breadcrumbs .popleft ()
953951
954952 def start_transaction (self , transaction = None , ** kwargs ):
955- # type: (Optional[Transaction ], Optional[SamplingContext], Unpack[TransactionKwargs]) -> Union[Transaction , NoOpSpan]
953+ # type: (Optional[Span ], Optional[SamplingContext], Unpack[TransactionKwargs]) -> Union[Span , NoOpSpan]
956954 """
957955 Start and return a transaction.
958956
@@ -981,14 +979,15 @@ def start_transaction(self, transaction=None, **kwargs):
981979 constructor. See :py:class:`sentry_sdk.tracing.Transaction` for
982980 available arguments.
983981 """
982+ # TODO-neel-potel fix signature and no op
984983 kwargs .setdefault ("scope" , self )
985984
986985 client = self .get_client ()
987986
988987 try_autostart_continuous_profiler ()
989988
990989 # if we haven't been given a transaction, make one
991- transaction = Transaction (** kwargs )
990+ transaction = Span (** kwargs )
992991
993992 # use traces_sample_rate, traces_sampler, and/or inheritance to make a
994993 # sampling decision
@@ -1024,6 +1023,7 @@ def start_span(self, **kwargs):
10241023
10251024 For supported `**kwargs` see :py:class:`sentry_sdk.tracing.Span`.
10261025 """
1026+ # TODO-neel-potel fix signature and no op
10271027 if kwargs .get ("description" ) is not None :
10281028 warnings .warn (
10291029 "The `description` parameter is deprecated. Please use `name` instead." ,
@@ -1054,13 +1054,14 @@ def start_span(self, **kwargs):
10541054 def continue_trace (
10551055 self , environ_or_headers , op = None , name = None , source = None , origin = None
10561056 ):
1057- # type: (Dict[str, Any], Optional[str], Optional[str], Optional[str], Optional[str]) -> Transaction
1057+ # TODO-neel-potel fix signature and no op
1058+ # type: (Dict[str, Any], Optional[str], Optional[str], Optional[str], Optional[str]) -> Span
10581059 """
10591060 Sets the propagation context from environment or headers and returns a transaction.
10601061 """
10611062 self .generate_propagation_context (environ_or_headers )
10621063
1063- transaction = Transaction .continue_from_headers (
1064+ transaction = Span .continue_from_headers (
10641065 normalize_incoming_data (environ_or_headers ),
10651066 op = op ,
10661067 origin = origin ,
0 commit comments