+
    Nig                        ^ RI t ^ RIt^ RIHtHtHt ^ RIHt ^ RIHt ^ RI	t	^ RI
HtHtHtHt ^ RIHt ^ RIHtHtHtHtHtHt ]'       dz   ^ RIHtHtHt ^ R	IHtHtHtHtH t H!t!H"t"H#t#H$t$H%t%H&t& ^ R
I'H(t(H)t) ]!! R4      t*]$! R4      t+^ RI,H-t-H.t.H/t/H0t0 ^ RIH1t1 ^ RI2H3t3  ! R R](RR7      t4 ! R R]4RR7      t5](! RR]6/4      t7Rt8Rt9 ! R R]6]4      t:]:Pv                  .t<R]:Pz                  R]:Pz                  R]:Pz                  R]:P|                  R ]:Pv                  R!]:Pz                  R"]:P|                  R#]:P|                  R$]:P|                  /	t?R% R& lt@ ! R' R(4      tA ! R) R*4      tB ! R+ R,]B4      tC ! R- R.]B4      tD]'       d-   ]&R:R/RR0RR1RR2]P                  /R3 R4 lll4       tF]&R5 R6 l4       tFR:R/RR0RR1RR2]P                  /R7 R8 llltF^ R9IGHHtHHItIHJtJHKtKHLtLHMtM R# );    N)datetime	timedeltatimezone)Enum)TYPE_CHECKING)INSTRUMENTERSPANDATA
SPANSTATUSSPANTEMPLATE)get_profiler_id)capture_internal_exceptionsget_current_thread_metais_valid_sample_rateloggernanosecond_timeshould_be_treated_as_error)CallableMappingMutableMapping)AnyDictIteratorListOptional	ParamSpecSetTupleTypeVarUnionoverload)	TypedDictUnpackPR)EventMeasurementUnitMeasurementValueSamplingContext)ContinuousProfile)Profilec                   H   a  ] tR t^1t o               V 3R ltRtV tR# )
SpanKwargsc                   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[;R&   S[;R&   S[ ;R&   S[ ;R&   R;R	&   S[ ;R
&   R;R&   R;R&   R;R&   S[ ;R&   S[ ;R&   # )   trace_idspan_idparent_span_idsame_process_as_parentsampledopdescriptionOptional[sentry_sdk.Hub]hubstatusOptional[Transaction]containing_transaction Optional[Union[datetime, float]]start_timestampzsentry_sdk.Scopescopeoriginnamestrbool)format__classdict__s   "9/tmp/pip-target-e6j6ikcs/lib/python/sentry_sdk/tracing.py__annotate__SpanKwargs.__annotate__1   s           !%$   ! , - 8 9 > ('? D E J !87K P <;Q \ "!] b c p 	q      N__name__
__module____qualname____firstlineno____annotate_func____static_attributes____classdictcell__rD   s   @rE   r,   r,   1   sZ     	 	U 	= 	K		 	Y 	t 	s 	9	 	Y	 	as  rH   r,   F)totalc                   2   a  ] tR t^lt o    V 3R ltRtV tR# )TransactionKwargsc                <   < V ^8  d   Qh/ S[ ;R&   S[;R&   R;R&   # )r.   sourceparent_sampledBaggagebaggager@   )rC   rD   s   "rE   rF   TransactionKwargs.__annotate__l   s)          rH   rI   NrJ   rR   s   @rE   rU   rU   l   s     	 	@ 	Q  rH   rU   ProfileContextprofiler_idrZ   zsentry-tracec                   J   a  ] tR t^t o RtRtRtRtRtRt	V 3R lR lt
R	tV tR
# )TransactionSource	componentcustomroutetaskurlviewc                    < V ^8  d   QhRS[ /# r.   returnrA   )rC   rD   s   "rE   rF   TransactionSource.__annotate__   s       rH   c                    V P                   # N)valueselfs   &rE   __str__TransactionSource.__str__   s    zzrH   rI   N)rK   rL   rM   rN   	COMPONENTCUSTOMROUTETASKURLVIEWrp   rP   rQ   rR   s   @rE   r_   r_      s-     IFED
CD rH   r_   endpointfunction_namehandler_namemethod_and_path_patternpath
route_nameroute_patternuri_templaterd   c                0    V ^8  d   QhR\         R\        /# )r.   http_status_coderh   )intrA   )rC   s   "rE   rF   rF      s     #$ #$S #$S #$rH   c                   V R8  d   \         P                  # RT u;8:  d   R8  d   M MV R8X  d   \         P                  # V R8X  d   \         P                  # V R8X  d   \         P                  # V R8X  d   \         P
                  # V R8X  d   \         P                  # V R8X  d   \         P                  # \         P                  # RT u;8:  d   R	8  dh   M \         P                  # V R
8X  d   \         P                  # V R8X  d   \         P                  # V R8X  d   \         P                  # \         P                  # \         P                  # )z
Returns the Sentry status corresponding to the given HTTP status code.

See: https://develop.sentry.dev/sdk/event-payloads/contexts/#trace-context
i  i  i  i  i  i  i  i  iX  i  i  i  )r
   OKPERMISSION_DENIED	NOT_FOUNDRESOURCE_EXHAUSTEDFAILED_PRECONDITIONUNAUTHENTICATEDALREADY_EXISTSINVALID_ARGUMENTDEADLINE_EXCEEDEDUNIMPLEMENTEDUNAVAILABLEINTERNAL_ERRORUNKNOWN_ERROR)r   s   &rE   get_span_status_from_http_coder      s    #}}	 	&3	&s"///$'''$000$111$---$,,,...	 	&3	& ### s"///$+++$))),,,###rH   c                   L   a  ] tR t^t o RtRtV 3R lR ltV 3R lR ltRtV t	R# )	_SpanRecorderz5Limits the number of spans recorded in a transaction.c                $   < V ^8  d   QhRS[ RR/# r.   maxlenrh   Nr   )rC   rD   s   "rE   rF   _SpanRecorder.__annotate__   s     $ $s $t $rH   c                >    V^,
          V n         . V n        ^ V n        R# )   Nr   spansdropped_spansro   r   s   &&rE   __init___SpanRecorder.__init__   s     qj#%
"#rH   c                "   < V ^8  d   QhRRRR/# )r.   spanSpanrh   NrI   )rC   rD   s   "rE   rF   r      s     $ $ $4 $rH   c                    \        V P                  4      V P                  8  d#   R Vn        V ;P                  ^,          un        R # V P                  P                  V4       R # rl   )lenr   r   _span_recorderr   append)ro   r   s   &&rE   add_SpanRecorder.add   sA    tzz?T[[("&D!#JJd#rH   )r   r   r   Nr   )
rK   rL   rM   rN   __doc__	__slots__r   r   rP   rQ   rR   s   @rE   r   r      s!     ?4I$ $$ $rH   r   c                     a  ] tR t^t o RtREtRFV 3R lR lltV 3R lR lt]V 3R lR l4       t	]	P                  V 3R	 lR
 l4       t	]V 3R lR l4       t]P                  V 3R lR l4       tV 3R lR ltV 3R lR ltV 3R lR lt]V 3R lR l4       t]P"                  3V 3R lR llt]V 3R lR l4       t]RR/V 3R lR ll4       tV 3R lR lt]V 3R  lR! l4       tV 3R" lR# ltV 3R$ lR% ltV 3R& lR' ltV 3R( lR) ltV 3R* lR+ ltV 3R, lR- ltV 3R. lR/ ltRGV 3R0 lR1 lltV 3R2 lR3 lt V 3R4 lR5 lt!V 3R6 lR7 lt"V 3R8 lR9 lt#RHV 3R: lR; llt$V 3R< lR= lt%V 3R> lR? lt&V 3R@ lRA lt'V 3RB lRC lt(RDt)V t*R# )Ir   a  A span holds timing information of a block of code.
Spans can have multiple child spans thus forming a span tree.

:param trace_id: The trace ID of the root span. If this new span is to be the root span,
    omit this parameter, and a new trace ID will be generated.
:param span_id: The span ID of this span. If omitted, a new span ID will be generated.
:param parent_span_id: The span ID of the parent span, if applicable.
:param same_process_as_parent: Whether this span is in the same process as the parent span.
:param sampled: Whether the span should be sampled. Overrides the default sampling decision
    for this span when provided.
:param op: The span's operation. A list of recommended values is available here:
    https://develop.sentry.dev/sdk/performance/span-operations/
:param description: A description of what operation is being performed within the span.

    .. deprecated:: 2.15.0
        Please use the `name` parameter, instead.
:param name: A string describing what operation is being performed within the span.
:param hub: The hub to use for this span.

    .. deprecated:: 2.0.0
        Please use the `scope` parameter, instead.
:param status: The span's status. Possible values are listed at
    https://develop.sentry.dev/sdk/event-payloads/span/
:param containing_transaction: The transaction that this span belongs to.
:param start_timestamp: The timestamp when the span started. If omitted, the current time
    will be used.
:param scope: The scope to use for this span. If not provided, we use the current scope.
Nc                Z   < V ^8  d   QhRRRRRRRS[ RRRRR	RR
RRRRRRRRRRS[RRRR/# )r.   r/   Optional[str]r0   r1   r2   r3   Optional[bool]r4   r5   r7   r6   r8   r:   r9   r<   r;   r=   Optional[sentry_sdk.Scope]r>   r?   rh   N)rB   rA   )rC   rD   s   "rE   rF   Span.__annotate__  s     >0 >0!>0 !>0 (	>0
 !%>0 ">0 >0 %>0 (>0  >0 !8>0 <>0 ,>0 >0 >0  
!>0rH   c                   Wn         W n        W0n        W@n        WPn        W`n        T;'       g    TV n        Wn        Wn        Wn	        Wn
        / V n        / V n        / V n        Wn        / V n        ^
V n        VeC   \"        P$                  ! R\&        ^R7       V P                  ;'       g    VP                  V n	        Vf&   \(        P*                  ! \,        P.                  4      pM;\1        V\2        4      '       d&   \(        P4                  ! V\,        P.                  4      pWn         \9        4       V n        RV n        RV n         V PC                  4        V PE                  \G        4       4       R#   \<         d     LFi ; i)
   Nz>The `hub` parameter is deprecated. Please use `scope` instead.
stacklevel)$	_trace_id_span_idr1   r2   r3   r4   r5   r8   r7   r=   r>   _measurements_tags_data_containing_transaction_flags_flags_capacitywarningswarnDeprecationWarningr   nowr   utc
isinstancefloatfromtimestampr<   r   _start_timestamp_monotonic_nsAttributeError	timestampr   update_active_threadset_profiler_idr   )ro   r/   r0   r1   r2   r3   r4   r5   r7   r8   r:   r<   r=   r>   r?   s   &&&&&&&&&&&&&&&rE   r   Span.__init__  s<   " ",&<#..;
<>13
')
'=$)+!?MMP" 00syyDJ"&ll8<<8O//&44_hllSO.	 2A1BD.
 049=!!#_./  		s   (E0 0E>=E>c                $   < V ^8  d   QhRS[ RR/# r   r   )rC   rD   s   "rE   rF   r   \  s     8 8 8 8rH   c                F    V P                   f   \        V4      V n         R # R # rl   )r   r   r   s   &&rE   init_span_recorderSpan.init_span_recorder\  s     &"/"7D 'rH   c                    < V ^8  d   QhRS[ /# rg   ri   )rC   rD   s   "rE   rF   r   a  s      # rH   c                    V P                   '       g%   \        P                  ! 4       P                  V n         V P                   # rl   )r   uuiduuid4hexrn   s   &rE   r/   Span.trace_id`  s(    ~~~!ZZ\--DN~~rH   c                $   < V ^8  d   QhRS[ RR/# r.   rm   rh   Nri   )rC   rD   s   "rE   rF   r   h  s      c d rH   c                    Wn         R # rl   )r   ro   rm   s   &&rE   r/   r   g  s    rH   c                    < V ^8  d   QhRS[ /# rg   ri   )rC   rD   s   "rE   rF   r   l  s       rH   c                    V P                   '       g,   \        P                  ! 4       P                  R ,          V n         V P                   # ):   NN)r   r   r   r   rn   s   &rE   r0   Span.span_idk  s-    }}} JJL,,S1DM}}rH   c                $   < V ^8  d   QhRS[ RR/# r   ri   )rC   rD   s   "rE   rF   r   s  s      S T rH   c                    Wn         R # rl   )r   r   s   &&rE   r0   r   r  s    rH   c                    < V ^8  d   QhRS[ /# rg   ri   )rC   rD   s   "rE   rF   r   v  s     
 
# 
rH   c                    R V P                   P                  : RV P                  : RV P                  : RV P                  : RV P
                  : RV P                  : RV P                  : RV P                  : R2# )	<z(op=z, description:, trace_id=
, span_id=, parent_span_id=
, sampled=	, origin=)>)		__class__rK   r4   r5   r/   r0   r1   r3   r>   rn   s   &rE   __repr__Span.__repr__v  sP     ''  ##
	
rH   c                   < V ^8  d   QhRR/# )r.   rh   r   rI   )rC   rD   s   "rE   rF   r     s      6 rH   c                    V P                   ;'       g    \        P                  ! 4       pVP                  pWn        W3V n        V # rl   )r=   
sentry_sdkget_current_scoper   _context_manager_state)ro   r=   old_spans   &  rE   	__enter__Span.__enter__  s:    

<<j::<::
',&7#rH   c                *   < V ^8  d   QhRRRRRRRR/# r.   tyzOptional[Any]rm   tbrh   NrI   )rC   rD   s   "rE   rF   r     s-     
" 
"!
"*9
"?N
"	
"rH   c                   Ve1   \        W4      '       d    V P                  \        P                  4       \	        4       ;_uu_ 4        V P
                  w  rEV =V P                  V4       WTn        R R R 4       R #   + '       g   i     R # ; irl   )r   
set_statusr
   r   r   r   finishr   )ro   r   rm   r   r=   r   s   &&&&  rE   __exit__Span.__exit__  sc     !;B!F!FOOJ556(**"99OE+KK!J	 +***s   (A99B
	c                   < V ^8  d   QhRR/# r.   rh   r9   rI   )rC   rD   s   "rE   rF   r     s     , ,(? ,rH   c                    V P                   # )zThe ``Transaction`` that this span belongs to.
The ``Transaction`` is the root of the span tree,
so one could also think of this ``Transaction`` as the "root span".)r   rn   s   &rE   r:   Span.containing_transaction  s     +++rH   c                (   < V ^8  d   QhRS[ RRRR/# )r.   instrumenterkwargsr   rh   r   ri   )rC   rD   s   "rE   rF   r     s%     ) ))AF)	)rH   c           	        VP                  R4      e   \        P                  ! R\        ^R7       \        P
                  ! 4       P                  R,          pW8w  d   \        4       # VP                  RV P                  4       \        R	RV P                  RV P                  RV P                  /VB pV P                  ;'       d    V P                  P                  pV'       d   VP                  V4       V# )
a  
Start a sub-span from the current span or transaction.

Takes the same arguments as the initializer of :py:class:`Span`. The
trace id, sampling decision, transaction pointer, and span recorder are
inherited from the current span/transaction.

The instrumenter parameter is deprecated for user code, and it will
be removed in the next major version. Going forward, it should only
be used by the SDK itself.
r5   zEThe `description` parameter is deprecated. Please use `name` instead.r   r  r3   r/   r1   r:   rI   )getr   r   r   r   
get_clientoptionsNoOpSpan
setdefaultr3   r   r/   r0   r:   r   r   )ro   r  r  configuration_instrumenterchildspan_recorders   &&,   rE   start_childSpan.start_child  s     ::m$0MMW" &0%:%:%<%D%D^%T"5:)T\\2 
]]
<<
 $(#>#>
 	
 ''VVD,G,G,V,V 	 e$rH   c                &   < V ^8  d   QhRRRRRR/# )r.   environMapping[str, str]r  r   rh   TransactionrI   )rC   rD   s   "rE   rF   r     s.     T T$T T 
	TrH   c                B    \         P                  ! \        V4      3/ VB # )a  
DEPRECATED: Use :py:meth:`sentry_sdk.continue_trace`.

Create a Transaction with the given params, then add in data pulled from
the ``sentry-trace`` and ``baggage`` headers from the environ (if any)
before returning the Transaction.

This is different from :py:meth:`~sentry_sdk.tracing.Span.continue_from_headers`
in that it assumes header names in the form ``HTTP_HEADER_NAME`` -
such as you would get from a WSGI/ASGI environ -
rather than the form ``header-name``.

:param environ: The ASGI/WSGI environ to pull information from.
)r  continue_from_headersEnvironHeaders)clsr  r  s   &&,rE   continue_from_environSpan.continue_from_environ  s    ( 001HSFSSrH   _sample_randc                *   < V ^8  d   QhRRRRRRRR/# )	r.   headersr  r  r   r  r   rh   r  rI   )rC   rD   s   "rE   rF   r     s3     ) )$) &	)
 ) 
)rH   c               `   \         P                  ! R4       \        P                  ! VP	                  \
        4      VR7      pVP                  \
        V/4       \        VP	                  \        4      4      pVe"   VP                  V4       VP                  4        \        R/ VB pRVn        V# )a  
DEPRECATED: Use :py:meth:`sentry_sdk.continue_trace`.

Create a transaction with the given params (including any data pulled from
the ``sentry-trace`` and ``baggage`` headers).

:param headers: The dictionary with the HTTP headers to pull information from.
:param _sample_rand: If provided, we override the sample_rand value from the
    incoming headers with this value. (internal use only)
z2Deprecated: use sentry_sdk.continue_trace instead.)r  FrI   )r   warningrY   from_incoming_headerr  BAGGAGE_HEADER_NAMEupdateextract_sentrytrace_dataSENTRY_TRACE_HEADER_NAMEfreezer  r2   )r  r  r  r  rZ   sentrytrace_kwargstransactions   &&$,   rE   r  Span.continue_from_headers  s    $ 	KL ..KK+,<
 	*G455KK01
 )MM,-
 NN!+F+-2*rH   c                   < V ^8  d   QhRR/# r.   rh   zIterator[Tuple[str, str]]rI   )rC   rD   s   "rE   rF   r     s     / /9 /rH   c              #     "   V P                   '       g   R# \        V P                  4       3x  V P                   P                  4       P	                  4       pV'       d   \
        V3x  R# R# 5i)z
Creates a generator which returns the span's ``sentry-trace`` and ``baggage`` headers.
If the span's containing transaction doesn't yet have a ``baggage`` value,
this will cause one to be generated and stored.
N)r:   r"  to_traceparentget_baggage	serializer  )ro   rZ   s   & rE   iter_headersSpan.iter_headers  s\      ***
 &(;(;(===--99;EEG%w.. s   AA-A-c                &   < V ^8  d   QhRRRRRR/# )r.   traceparentr   r  r   rh   r9   rI   )rC   rD   s   "rE   rF   r   $  s)     
 
$
 
 
!	
rH   c                H    V'       g   R# V P                   ! \        V/3/ VB # )z
DEPRECATED: Use :py:meth:`sentry_sdk.continue_trace`.

Create a ``Transaction`` with the given params, then add in data pulled from
the given ``sentry-trace`` header value before returning the ``Transaction``.
N)r  r"  )r  r0  r  s   &&,rE   from_traceparentSpan.from_traceparent#  s-     ((%{3
7=
 	
rH   c                    < V ^8  d   QhRS[ /# rg   ri   )rC   rD   s   "rE   rF   r   6  s       rH   c                    V P                   R J d   RpMV P                   RJ d   RpMRpV P                  : RV P                  : 2pVe   VRV: 2,          pV# )T1F0N-)r3   r/   r0   )ro   r3   r0  s   &  rE   r*  Span.to_traceparent6  sT    <<4G\\U"GG!%=G--KrH   c                   < V ^8  d   QhRR/# r.   rh   Optional[Baggage]rI   )rC   rD   s   "rE   rF   r   D  s      / rH   c                ^    V P                   '       d   V P                   P                  4       # R# )zReturns the :py:class:`~sentry_sdk.tracing_utils.Baggage`
associated with this ``Span``, if any. (Taken from the root of the span tree.)
N)r:   r+  rn   s   &rE   
to_baggageSpan.to_baggageD  s(     &&&..::<<rH   c                (   < V ^8  d   QhRS[ RRRR/# r.   keyrm   r   rh   Nri   )rC   rD   s   "rE   rF   r   L  s"        3  u    rH   c                "    W P                   V&   R # rl   )r   ro   rB  rm   s   &&&rE   set_tagSpan.set_tagL      

3rH   c                (   < V ^8  d   QhRS[ RRRR/# rA  ri   )rC   rD   s   "rE   rF   r   O  s"        C    $  rH   c                "    W P                   V&   R # rl   )r   rD  s   &&&rE   set_dataSpan.set_dataO  rG  rH   c                "   < V ^8  d   QhRRRR/# r.   dataDict[str, Any]rh   NrI   )rC   rD   s   "rE   rF   r   R  s         0  T  rH   c                <    V P                   P                  V4       R # rl   )r   r   ro   rN  s   &&rE   update_dataSpan.update_dataR  s    

$rH   c                *   < V ^8  d   QhRS[ RS[RR/# )r.   flagresultrh   Nr@   )rC   rD   s   "rE   rF   r   U  s"     ' 'S '$ '4 'rH   c                n    \        V P                  4      V P                  8  d   W P                  V&   R # R # rl   )r   r   r   )ro   rU  rV  s   &&&rE   set_flagSpan.set_flagU  s*    t{{d222 &KK 3rH   c                $   < V ^8  d   QhRS[ RR/# r   ri   )rC   rD   s   "rE   rF   r   Y  s        rH   c                    Wn         R # rl   r8   r   s   &&rE   r   Span.set_statusY  s    rH   c                .   < V ^8  d   QhRS[ RS[RRRR/# r.   r?   rm   unitr&   rh   NrA   r   )rC   rD   s   "rE   rF   r   \  3     B BB %B->B	BrH   c                f    \         P                  ! R\        ^R7       RVRV/V P                  V&   R# zg
.. deprecated:: 2.28.0
    This function is deprecated and will be removed in the next major release.
zq`set_measurement()` is deprecated and will be removed in the next major version. Please use `set_data()` instead.r   rm   r`  Nr   r   r   r   ro   r?   rm   r`  s   &&&&rE   set_measurementSpan.set_measurement\  4     		

 %,UFD#A4 rH   c                &   < V ^8  d   QhRRRRRR/# )r.   	thread_idzOptional[int]thread_namer   rh   NrI   )rC   rD   s   "rE   rF   r   k  s*     A A(A7FA	ArH   c                    VeR   V P                  \        P                  \        V4      4       Ve#   V P                  \        P                  V4       R # R # R # rl   )rJ  r	   	THREAD_IDrA   THREAD_NAMEro   rk  rl  s   &&&rE   
set_threadSpan.set_threadk  sF      MM(,,c)n=&h22K@ ' !rH   c                "   < V ^8  d   QhRRRR/# )r.   r]   r   rh   NrI   )rC   rD   s   "rE   rF   r   t  s     = =? =t =rH   c                R    Ve#   V P                  \        P                  V4       R # R # rl   )rJ  r	   PROFILER_IDro   r]   s   &&rE   r   Span.set_profiler_idt  s!    "MM(..< #rH   c                $   < V ^8  d   QhRS[ RR/# r.   http_statusrh   Nr   )rC   rD   s   "rE   rF   r   x  s     E E3 E4 ErH   c                    V P                  R \        V4      4       V P                  \        P                  V4       V P                  \        V4      4       R# )zhttp.status_codeN)rE  rA   rJ  r	   HTTP_STATUS_CODEr   r   ro   rz  s   &&rE   set_http_statusSpan.set_http_statusx  s@    K 0	
 	h//=6{CDrH   c                    < V ^8  d   QhRS[ /# rg   rB   )rC   rD   s   "rE   rF   r     s     # #D #rH   c                     V P                   R 8H  # )okr\  rn   s   &rE   
is_successSpan.is_success  s    {{d""rH   c                &   < V ^8  d   QhRRRRRR/# )r.   r=   r   end_timestamp Optional[Union[float, datetime]]rh   r   rI   )rC   rD   s   "rE   rF   r     s)     ' '+' :' 
	'rH   c                   V P                   e   R#  V'       dC   \        V\        4      '       d&   \        P                  ! V\
        P                  4      pW n         ME\        4       V P                  ,
          pV P                  \        VR,          R7      ,           V n          T;'       g    \        P                  ! 4       p\        W4       R#   \         d-    \        P                  ! \
        P                  4      T n          Lbi ; i)a  
Sets the end timestamp of the span.

Additionally it also creates a breadcrumb from the span,
if the span represents a database or HTTP request.

:param scope: The scope to use for this transaction.
    If not provided, the current scope will be used.
:param end_timestamp: Optional timestamp that should
    be used as timestamp instead of the current time.

:return: Always ``None``. The type is ``Optional[str]`` to match
    the return value of :py:meth:`sentry_sdk.tracing.Transaction.finish`.
Ni  )microseconds)r   r   r   r   r   r   r   r   r   r<   r   r   r   r   r   "maybe_create_breadcrumbs_from_span)ro   r=   r  elapseds   &&& rE   r   Span.finish  s    & >>%	8mU33$,$:$:=(,,$WM!.)+d.P.PP!%!5!5	!(49 " 77557*57  	8%\\(,,7DN	8s   C AC AC 4DDc                   < V ^8  d   QhRR/# r.   rh   rO  rI   )rC   rD   s   "rE   rF   r     s     ! !) !rH   c                `   RV P                   RV P                  RV P                  RV P                  RV P                  RV P
                  RV P                  RV P                  R	V P                  /	pV P                  '       d)   V P                  VR
&   V P                  V P                  R
&   \        V P                  4      ^ 8  d   V P                  VR&   V P                  pV'       d   W!R&   / pVP                  V P                  4       VP                  V P                  4       V'       d   W1R&   V# )z5Returns a JSON-compatible representation of the span.r/   r0   r1   r2   r4   r5   r<   r   r>   r8   measurementstagsrN  )r/   r0   r1   r2   r4   r5   r<   r   r>   r8   r   r   r   r   r   r   )ro   rvr  rN  s   &   rE   to_jsonSpan.to_json  s     t||d11$d&A&A$''4++t33dkk
 
 ;;;;;BxL#';;DJJx t!!"Q&!%!3!3B~zzvJDKK DJJvJ	rH   c                   < V ^8  d   QhRR/# r.   rh   r   rI   )rC   rD   s   "rE   rF   r     s      5 rH   c                6   R V P                   RV P                  RV P                  RV P                  RV P                  RV P
                  /pV P                  '       d   V P                  VR&   V P                  '       d,   V P                  P                  4       P                  4       VR&   / pV P                  P                  \        P                  4      pVe   W2R&   V P                  P                  \        P                  4      pVe   WBR	&   V'       d   W!R
&   V# )r/   r0   r1   r4   r5   r>   r8   dynamic_sampling_contextz	thread.idzthread.namerN  )r/   r0   r1   r4   r5   r>   r8   r:   r+  r  r   r  r	   rn  ro  )ro   r  rN  rk  rl  s   &    rE   get_trace_contextSpan.get_trace_context  s    t||d11$''4++dkk 
 ;;;;;BxL&&&++779RRT )* JJNN8#5#56	  )jjnnX%9%9:""-vJ	rH   c                   < V ^8  d   QhRR/# )r.   rh   zOptional[ProfileContext]rI   )rC   rD   s   "rE   rF   r     s     
 
%? 
rH   c                h    V P                   P                  \        P                  4      pVf   R # RV/# )Nr]   )r   r  r	   ru  rv  s   & rE   get_profile_contextSpan.get_profile_context  s4    jjnnX%9%9: ;
 	
rH   c                   < V ^8  d   QhRR/# )r.   rh   NrI   )rC   rD   s   "rE   rF   r     s     0 0d 0rH   c                @    \        4       w  rV P                  W4       R # rl   )r   rq  rp  s   &  rE   r   Span.update_active_thread  s    !8!:		/rH   )r   r   r   r   r   r   r   r   r   r   r   r5   r7   r4   r>   r1   r2   r3   r=   r<   r8   r   )r   r   r1   r2   r3   r4   r5   r   r<   r   r8   r   r   r   r   r7   r   r   r=   r>   r?   r   r   )NNNTNNNNNNNNmanualN NN)+rK   rL   rM   rN   r   r   r   r   propertyr/   setterr0   r   r   r   r:   r   SENTRYr  classmethodr  r  r-  r2  r*  r>  rE  rJ  rR  rX  r   rg  rq  r   r~  r  r   r  r  r  r   rP   rQ   rR   s   @rE   r   r      s    :I4>0 >0D8 8   __    ^^ 
 
 
" 
" , , #/"5"5) )V T T* ) )-	) ) )V/ /& 
 
$           ' ' B BA A= =E E# #' 'R! !F @
 
0 0rH   r   c                     a a ] tR tRt oRtR'tRRR]P                  3V3R lV 3R llltV3R lR lt	V3R	 lR
 lt
V3R lV 3R lltV3R lV 3R llt]V3R lR l4       tV3R lR ltV3R lR ltR(RR/V3R lV 3R lllltR)V3R lR lltV3R lR ltV3R lV 3R lltV3R lV 3R lltV3R  lV 3R! lltV3R" lR# ltV3R$ lR% ltR&tVtV ;t# )*r  i  a1  The Transaction is the root element that holds all the spans
for Sentry performance instrumentation.

:param name: Identifier of the transaction.
    Will show up in the Sentry UI.
:param parent_sampled: Whether the parent transaction was sampled.
    If True this transaction will be kept, if False it will be discarded.
:param baggage: The W3C baggage header value.
    (see https://www.w3.org/TR/baggage/)
:param source: A string describing the source of the transaction name.
    This will be used to determine the transaction's type.
    See https://develop.sentry.dev/sdk/event-payloads/transaction/#transaction-annotations
    for more information. Default "custom".
:param kwargs: Additional arguments to be passed to the Span constructor.
    See :py:class:`sentry_sdk.tracing.Span` for available arguments.
r  Nc                6   < V ^8  d   QhRS[ RRRRRS[ RRR	R
/# )r.   r?   rX   r   rZ   r<  rW   r  zUnpack[SpanKwargs]rh   Nri   )rC   rD   s   "rE   rF   Transaction.__annotate__  sO     E EE )E %	E
 E 'E 
ErH   c                >  < \         SV `  ! R/ VB  Wn        W@n        R V n        W n        / V n        / V n        R V n        R V n	        W0n
        V P                  f   R MV P                  P                  4       pVe	   W`n        R # \        V P                  4      V n        R # NrI   )superr   r?   rW   sample_raterX   r   	_contexts_profile_continuous_profile_baggager  _generate_sample_randr/   )ro   r?   rX   rZ   rW   r  baggage_sample_randr   s   &&&&&, rE   r   Transaction.__init__  s     	"6"	.2,<>+--1BF  MM)Dt}}/I/I/K 	 * 3 5dmm DDrH   c                    < V ^8  d   QhRS[ /# rg   ri   )rC   rD   s   "rE   rF   r  8  s     
 
# 
rH   c                   R V P                   P                  : RV P                  : RV P                  : RV P                  : RV P
                  : RV P                  : RV P                  : RV P                  : RV P                  : R	2# )
r   z(name=z, op=r   r   r   r   z	, source=r   r   )
r   rK   r?   r4   r/   r0   r1   r3   rW   r>   rn   s   &rE   r   Transaction.__repr__8  sU     ''		##	
rH   c                    < V ^8  d   QhRS[ /# rg   r  )rC   rD   s   "rE   rF   r  H  s     	H 	H4 	HrH   c                J    V P                   RJ;'       g    V P                  RJ # )zReturns whether the transaction might have been started.

If this returns False, we know that the transaction was not started
with sentry_sdk.start_transaction, and therefore the transaction will
be discarded.
NF)r   r3   rn   s   &rE   _possibly_startedTransaction._possibly_startedH  s&     ""$.GG$,,%2GGrH   c                   < V ^8  d   QhRR/# r.   rh   r  rI   )rC   rD   s   "rE   rF   r  S  s      = rH   c                   < V P                  4       '       g   \        P                  ! R 4       \        SV `  4        V P
                  e   V P
                  P	                  4        V # )zTransaction was entered without being started with sentry_sdk.start_transaction.The transaction will not be sent to Sentry. To fix, start the transaction bypassing it to sentry_sdk.start_transaction.)r  r   debugr  r   r  )ro   r   s   &rE   r   Transaction.__enter__S  sO    %%''LL> 	==$MM##%rH   c                *   < V ^8  d   QhRRRRRRRR/# r   rI   )rC   rD   s   "rE   rF   r  b  s-     	( 	(!	(*9	(?N	(		(rH   c                   < V P                   e   V P                   P                  WV4       V P                  e   V P                  P                  4        \        SV `  WV4       R # rl   )r  r   r  stopr  )ro   r   rm   r   r   s   &&&&rE   r   Transaction.__exit__b  sP     ==$MM""2b1##/$$))+B'rH   c                   < V ^8  d   QhRR/# r  rI   )rC   rD   s   "rE   rF   r  n  s       rH   c                    V # )z^The root element of the span tree.
In the case of a transaction it is the transaction itself.
rI   rn   s   &rE   r:   "Transaction.containing_transactionm  s	     rH   c                &   < V ^8  d   QhRRRRRR/# )r.   	scope_argz1Optional[Union[sentry_sdk.Scope, sentry_sdk.Hub]]hub_argrh   r   rI   )rC   rD   s   "rE   rF   r  x  s*      F E 
&	rH   c                    TpVe    \         P                  ! R\        ^R7       Tp\        V\        P
                  4      '       d*   \         P                  ! R\        ^R7       VP                  # V# )z
Logic to get the scope from the arguments passed to finish. This
function exists for backwards compatibility with the old finish.

TODO: Remove this function in the next major version.
zMThe `hub` parameter is deprecated. Please use the `scope` parameter, instead.r   zDPassing a Hub to finish is deprecated. Please pass a Scope, instead.)r   r   r   r   r   Hubr=   )ro   r  r  scope_or_hubs   &&& rE   _get_scope_from_finish_args'Transaction._get_scope_from_finish_argsx  se     !MM_" #LlJNN33MMV"  %%%rH   c                    < V ^8  d   QhRS[ /# rg   ri   )rC   rD   s   "rE   rF   r    s     
 
 
rH   c                    R P                  V P                  '       d   RV P                  ,           R,           MRV P                  R7      # )z{op}transaction <{name}>r   z> r  )r4   r?   )rC   r4   r?   rn   s   &rE   _get_log_representation#Transaction._get_log_representation  s:    )00(,dgg$Rtyy 1 
 	
rH   r7   c                *   < V ^8  d   QhRRRRRRRR/# 	r.   r=   r   r  r  r7   r6   rh   r   rI   )rC   rD   s   "rE   rF   r    s9     R* R*+R* :R*
 (R* 
R*rH   c               n	  < V P                   e   R# V P                  W4      pT;'       g*    V P                  ;'       g    \        P                  ! 4       p\        P
                  ! 4       pVP                  4       '       g   R# V P                  f   V P                  RJ d   \        P                  ! R4       M\        P                  ! R4       VP                  '       d   \        VP                  4      '       dm   VP                  '       d   VP                  P                  ^ 8  d   RpMRpVP                  P!                  VRR7       VP                  P!                  VR	R7       R# V P"                  '       g   \        P$                  ! R
4       RV n        \&        SV `Q  W4       V P*                  P-                  \.        P0                  4      pVe   WdP                  R,          9   d   \        P                  ! RP3                  V P5                  4       V P*                  \.        P0                  ,          VP                  R,          R7      4       VP                  '       db   VP                  P!                  RRR7       \7        V P                  P8                  4      ^,           pVP                  P!                  RR	VR7       RV n        V P                  '       g'   V P                  f   \        P$                  ! R4       R# V P                  P8                   Uu. uF#  pVP                   f   K  VP;                  4       NK%  	  p	p\7        V P                  P8                  4      \7        V	4      ,
          p
WP                  P<                  ,           pRV n        / pVP?                  V P@                  4       VP?                  RV PC                  4       /4       V PE                  4       pVe   VP?                  RV/4       RRRV P"                  RRV PF                  /RVRV PH                  RV P                   RV PJ                  RV	/pV^ 8  d   WR&   V PL                  e7   V PL                  PO                  4       '       d   V PL                  VR&   RV n&        V PP                  VR&   VPS                  V4      # u upi )a  Finishes the transaction and sends it to Sentry.
All finished spans in the transaction will also be sent to Sentry.

:param scope: The Scope to use for this transaction.
    If not provided, the current Scope will be used.
:param end_timestamp: Optional timestamp that should
    be used as timestamp instead of the current time.
:param hub: The hub to use for this transaction.
    This argument is DEPRECATED. Please use the `scope`
    parameter, instead.

:return: The event ID if the transaction was sent to Sentry,
    otherwise None.
NFz.Discarding transaction because sampled = FalsezSDiscarding transaction because it was not started with sentry_sdk.start_transactionbackpressurer  r%  )data_categoryr   zCTransaction has no name, falling back to `<unlabeled transaction>`.z<unlabeled transaction>trace_ignore_status_codesz[Tracing] Discarding {transaction_description} because the HTTP status code {status_code} is matched by trace_ignore_status_codes: {trace_ignore_status_codes})transaction_descriptionstatus_coder  event_processor)r  quantityz1Discarding transaction without sampling decision.traceprofiletypetransaction_inforW   contextsr  r   r<   r   _dropped_spansr  )*r   r  r=   r   r   r  	is_activer   r3   r   r  	transporthas_tracing_enabledr  monitordownsample_factorrecord_lost_eventr?   r  r  r   r   r  r	   r|  rC   r  r   r   r  r   r   r  r  r  rW   r   r<   r  validr   capture_event)ro   r=   r  r7   clientreasonr  	num_spansr   finished_spanslen_diffr   r  profile_contexteventr   s   &&&$           rE   r   Transaction.finish  s   * >>% /3.N.N/
 EEEEz'C'C'E&&(!!&||u$MNi $7$G$G>>>fnn&F&F&J+F*F  2262W   2262PyyyNNU 2DIu,jjnnX%>%>?#~~.IJJLL q  x  x,0,H,H,J $

8+D+D E.4nn3/ x    22%] 3    3 3 9 9:Q>	  22%Vi 3  !DL||| ||#RS ++11
1~~ DLLN1 	 
 t**001C4GG #6#6#D#DD #'$"8"8":;<224&OOY89 M4994;; 7DJJt33^	
 1&3"#==$)<)<)>)>#}}E) DM $ 2 2n""5))U
s   R20R2c                .   < V ^8  d   QhRS[ RS[RRRR/# r_  ra  )rC   rD   s   "rE   rF   r  1  rb  rH   c                f    \         P                  ! R\        ^R7       RVRV/V P                  V&   R# rd  re  rf  s   &&&&rE   rg  Transaction.set_measurement1  ri  rH   c                (   < V ^8  d   QhRS[ RRRR/# r.   rB  rm   zdict[str, Any]rh   Nri   )rC   rD   s   "rE   rF   r  @  s#     $ $s $+; $ $rH   c                "    W P                   V&   R# )zSets a context. Transactions can have multiple contexts
and they should follow the format described in the "Contexts Interface"
documentation.

:param key: The name of the context.
:param value: The information about the context.
N)r  rD  s   &&&rE   set_contextTransaction.set_context@  s     $srH   c                $   < V ^8  d   QhRS[ RR/# ry  r   )rC   rD   s   "rE   rF   r  J  s     C C3 C4 CrH   c                N   < \         SV `  V4       V P                  RRV/4       R# )zqSets the status of the Transaction according to the given HTTP status.

:param http_status: The HTTP status code.responser  N)r  r~  r  )ro   rz  r   s   &&rE   r~  Transaction.set_http_statusJ  s'     	,m[%ABrH   c                   < V ^8  d   QhRR/# r  rI   )rC   rD   s   "rE   rF   r  Q  s      ) rH   c                ~   < \         SV `  4       pV P                  VR&   V P                  VR&   V P                  VR&   V# )z<Returns a JSON-compatible representation of the transaction.r?   rW   r3   )r  r  r?   rW   r3   )ro   r  r   s   & rE   r  Transaction.to_jsonQ  s;    W_YY6
{{89	rH   c                   < V ^8  d   QhRR/# r  rI   )rC   rD   s   "rE   rF   r  [  s      5 rH   c                f   < \         SV `  4       pV P                  '       d   V P                  VR &   V# )rN  )r  r  r   )ro   trace_contextr   s   & rE   r  Transaction.get_trace_context[  s-    13:::$(JJM&!rH   c                   < V ^8  d   QhRR/# )r.   rh   rY   rI   )rC   rD   s   "rE   rF   r  c  s     	 	Y 	rH   c                    V P                   '       d   V P                   P                  '       d   \        P                  ! V 4      V n         V P                   # )zReturns the :py:class:`~sentry_sdk.tracing_utils.Baggage`
associated with the Transaction.

The first time a new baggage with Sentry items is made,
it will be frozen.)r  mutablerY   populate_from_transactionrn   s   &rE   r+  Transaction.get_baggagec  s8     }}} 5 5 5#==dCDM}}rH   c                "   < V ^8  d   QhRRRR/# r.   sampling_contextr(   rh   NrI   )rC   rD   s   "rE   rF   r  n  s!     c c 1c	crH   c           
        \         P                  ! 4       pV P                  4       p\        VP                  4      '       g
   RV n        R# V P
                  e   \        V P
                  4      V n        R# \        VP                  P                  R4      4      '       d   VP                  R,          ! V4      M&VR,          e
   VR,          MVP                  R,          p\        VRR7      '       g0   \        P                  ! RP                  VR	7      4       RV n        R# \        V4      V n        VP                  '       d5   V ;P                  ^VP                  P                  ,          ,          un        V P                  '       g]   \        P                   ! R
P                  T\        VP                  P                  R4      4      '       d   RMRR7      4       RV n        R# V P"                  V P                  8  V n        V P
                  '       d)   \        P                   ! RP                  VR	7      4       R# \        P                   ! RP                  VV P                  R7      4       R# )a  
Sets the transaction's sampling decision, according to the following
precedence rules:

1. If a sampling decision is passed to `start_transaction`
(`start_transaction(name: "my transaction", sampled: True)`), that
decision will be used, regardless of anything else

2. If `traces_sampler` is defined, its decision will be used. It can
choose to keep or ignore any parent sampling decision, or use the
sampling context data to make its own decision or to choose a sample
rate for the transaction.

3. If `traces_sampler` is not defined, but there's a parent sampling
decision, the parent sampling decision will be used.

4. If `traces_sampler` is not defined and there's no parent sampling
decision, `traces_sample_rate` will be used.
FNtraces_samplerrX   traces_sample_rateTracing)rW   zN[Tracing] Discarding {transaction_description} because of invalid sample rate.)r  z?[Tracing] Discarding {transaction_description} because {reason}z"traces_sampler returned 0 or Falseztraces_sample_rate is set to 0)r  r  z,[Tracing] Starting {transaction_description}z}[Tracing] Discarding {transaction_description} because it's not included in the random sample (sampling rate = {sample_rate}))r  r  )r   r  r  r  r  r3   r   r  callabler  r   r   r  rC   r  r  r  r  )ro   r  r  r  r  s   &&   rE   _set_initial_sampling_decision*Transaction._set_initial_sampling_decisionn  s   , &&("&">">"@ #6>>22 DL <<#$T\\2D **+;<== NN+,-=>
 $$45A !!12^^$89 	 $K	BBNN`gg,C h 
 !DL ->>>6>>#C#C CC LLQXX,C $FNN$6$67G$HII == Y 	 !DL ((4+;+;;<<<LL>EE,C F  LL P  W  W,C $ 0 0 W rH   )r  r  r  r   r  r  r   r?   rX   r  r3   rW   )
r?   rW   rX   r  r   r  r  r  r  r  r  r  )rK   rL   rM   rN   r   r   r_   rs   r   r   r  r   r   r  r:   r  r  r   rg  r  r~  r  r  r+  r  rP   rQ   __classcell__)r   rD   s   @@rE   r  r    s     "I  +/'+'..E E8
 
 	H 	H 	( 	(   @
 

R*
 +/R* R*hB B$ $C C  	 	c c crH   r  c                     a  ] tR tRt o V 3R lR lt]V 3R lR l4       t]P                  3V 3R lR llt	V 3R lR	 lt
V 3R
 lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R  lR! ltR/R#R"/V 3R$ lR% llltR0V 3R& lR' lltV 3R( lR) ltV 3R* lR+ ltV 3R, lR- ltR.tV tR"# )1r  i  c                    < V ^8  d   QhRS[ /# rg   ri   )rC   rD   s   "rE   rF   NoOpSpan.__annotate__  s     0 0# 0rH   c                <    R V P                   P                  ,          # )z<%s>)r   rK   rn   s   &rE   r   NoOpSpan.__repr__  s    ////rH   c                   < V ^8  d   QhRR/# r   rI   )rC   rD   s   "rE   rF   r    s      (? rH   c                    R # rl   rI   rn   s   &rE   r:   NoOpSpan.containing_transaction  s    rH   c                (   < V ^8  d   QhRS[ RRRR/# )r.   r  r  r   rh   r  ri   )rC   rD   s   "rE   rF   r    s%      AF	rH   c                    \        4       # rl   )r  )ro   r  r  s   &&,rE   r  NoOpSpan.start_child  s     zrH   c                    < V ^8  d   QhRS[ /# rg   ri   )rC   rD   s   "rE   rF   r    s       rH   c                    R # r  rI   rn   s   &rE   r*  NoOpSpan.to_traceparent  s    rH   c                   < V ^8  d   QhRR/# r;  rI   )rC   rD   s   "rE   rF   r    s      / rH   c                    R # rl   rI   rn   s   &rE   r>  NoOpSpan.to_baggage      rH   c                   < V ^8  d   QhRR/# r;  rI   )rC   rD   s   "rE   rF   r    s      0 rH   c                    R # rl   rI   rn   s   &rE   r+  NoOpSpan.get_baggage  r,  rH   c                   < V ^8  d   QhRR/# r(  rI   )rC   rD   s   "rE   rF   r    s      9 rH   c                    \        R4      # r  )iterrn   s   &rE   r-  NoOpSpan.iter_headers  s    BxrH   c                (   < V ^8  d   QhRS[ RRRR/# rA  ri   )rC   rD   s   "rE   rF   r    s"      3 u  rH   c                    R # rl   rI   rD  s   &&&rE   rE  NoOpSpan.set_tag      rH   c                (   < V ^8  d   QhRS[ RRRR/# rA  ri   )rC   rD   s   "rE   rF   r    s"      C  $ rH   c                    R # rl   rI   rD  s   &&&rE   rJ  NoOpSpan.set_data  r7  rH   c                "   < V ^8  d   QhRRRR/# rM  rI   )rC   rD   s   "rE   rF   r    s       0 T rH   c                    R # rl   rI   rQ  s   &&rE   rR  NoOpSpan.update_data  r7  rH   c                $   < V ^8  d   QhRS[ RR/# r   ri   )rC   rD   s   "rE   rF   r    s        rH   c                    R # rl   rI   r   s   &&rE   r   NoOpSpan.set_status  r7  rH   c                $   < V ^8  d   QhRS[ RR/# ry  r   )rC   rD   s   "rE   rF   r    s      3 4 rH   c                    R # rl   rI   r}  s   &&rE   r~  NoOpSpan.set_http_status  r7  rH   c                    < V ^8  d   QhRS[ /# rg   r  )rC   rD   s   "rE   rF   r    s      D rH   c                    R # )TrI   rn   s   &rE   r  NoOpSpan.is_success  r,  rH   c                   < V ^8  d   QhRR/# r  rI   )rC   rD   s   "rE   rF   r    s      ) rH   c                    / # rl   rI   rn   s   &rE   r  NoOpSpan.to_json      	rH   c                   < V ^8  d   QhRR/# r  rI   )rC   rD   s   "rE   rF   r    s      5 rH   c                    / # rl   rI   rn   s   &rE   r  NoOpSpan.get_trace_context  rJ  rH   c                   < V ^8  d   QhRR/# r  rI   )rC   rD   s   "rE   rF   r    s      U rH   c                    / # rl   rI   rn   s   &rE   r  NoOpSpan.get_profile_context  rJ  rH   Nr7   c                *   < V ^8  d   QhRRRRRRRR/# r  rI   )rC   rD   s   "rE   rF   r    s3     
 
+
 :

 (
 

rH   c                   R# )zO
The `hub` parameter is deprecated. Please use the `scope` parameter, instead.
NrI   )ro   r=   r  r7   s   &&&$rE   r   NoOpSpan.finish       	rH   c                .   < V ^8  d   QhRS[ RS[RRRR/# r_  ra  )rC   rD   s   "rE   rF   r    s-       %->	rH   c                    R # rl   rI   rf  s   &&&&rE   rg  NoOpSpan.set_measurement       	rH   c                (   < V ^8  d   QhRS[ RRRR/# r  ri   )rC   rD   s   "rE   rF   r    s#      s +;  rH   c                    R # rl   rI   rD  s   &&&rE   r  NoOpSpan.set_context  r7  rH   c                $   < V ^8  d   QhRS[ RR/# r   r   )rC   rD   s   "rE   rF   r    s        rH   c                    R # rl   rI   r   s   &&rE   r   NoOpSpan.init_span_recorder  r7  rH   c                "   < V ^8  d   QhRRRR/# r  rI   )rC   rD   s   "rE   rF   r    s       1	rH   c                    R # rl   rI   )ro   r  s   &&rE   r  'NoOpSpan._set_initial_sampling_decision  rX  rH   rI   r  r  )rK   rL   rM   rN   r   r  r:   r   r  r  r*  r>  r+  r-  rE  rJ  rR  r   r~  r  r  r  r  r   rg  r  r   r  rP   rQ   rR   s   @rE   r  r    s     0 0   #/"5"5 
             

 +/
 
 
   rH   r  r4   r?   
attributestemplatec                0    V ^8  d   QhRRRRRRRRRR	R
R/# )r.   funcNr4   r   r?   rb  Optional[dict[str, Any]]rc  r   rh   z*Callable[[Callable[P, R]], Callable[P, R]]rI   )rC   s   "rE   rF   rF   (  sF     	 		 	 		
 /	 !	 
6	rH   c                    R # rl   rI   )re  r4   r?   rb  rc  s   &$$$$rE   r  r  '  rT  rH   c                     V ^8  d   QhRRRR/# )r.   re  zCallable[P, R]rh   rI   )rC   s   "rE   rF   rF   4  s      $ )9 rH   c                     R # rl   rI   )re  s   &rE   r  r  3  rX  rH   c                0    V ^8  d   QhRRRRRRRRRR	R
R/# )r.   re  zOptional[Callable[P, R]]r4   r   r?   rb  rf  rc  r   rh   zAUnion[Callable[P, R], Callable[[Callable[P, R]], Callable[P, R]]]rI   )rC   s   "rE   rF   rF   9  sO     V V
$V 	V 	V
 +V V IVrH   c               J    ^ RI Hp V! VVVVR7      pV '       d	   V! V 4      # V# )a	  
Decorator to start a child span around a function call.

This decorator automatically creates a new span when the decorated function
is called, and finishes the span when the function returns or raises an exception.

:param func: The function to trace. When used as a decorator without parentheses,
    this is the function being decorated. When used with parameters (e.g.,
    ``@trace(op="custom")``, this should be None.
:type func: Callable or None

:param op: The operation name for the span. This is a high-level description
    of what the span represents (e.g., "http.client", "db.query").
    You can use predefined constants from :py:class:`sentry_sdk.consts.OP`
    or provide your own string. If not provided, a default operation will
    be assigned based on the template.
:type op: str or None

:param name: The human-readable name/description for the span. If not provided,
    defaults to the function name. This provides more specific details about
    what the span represents (e.g., "GET /api/users", "process_user_data").
:type name: str or None

:param attributes: A dictionary of key-value pairs to add as attributes to the span.
    Attribute values must be strings, integers, floats, or booleans. These
    attributes provide additional context about the span's execution.
:type attributes: dict[str, Any] or None

:param template: The type of span to create. This determines what kind of
    span instrumentation and data collection will be applied. Use predefined
    constants from :py:class:`sentry_sdk.consts.SPANTEMPLATE`.
    The default is `SPANTEMPLATE.DEFAULT` which is the right choice for most
    use cases.
:type template: :py:class:`sentry_sdk.consts.SPANTEMPLATE`

:returns: When used as ``@trace``, returns the decorated function. When used as
    ``@trace(...)`` with parameters, returns a decorator function.
:rtype: Callable or decorator function

Example::

    import sentry_sdk
    from sentry_sdk.consts import OP, SPANTEMPLATE

    # Simple usage with default values
    @sentry_sdk.trace
    def process_data():
        # Function implementation
        pass

    # With custom parameters
    @sentry_sdk.trace(
        op=OP.DB_QUERY,
        name="Get user data",
        attributes={"postgres": True}
    )
    def make_db_query(sql):
        # Function implementation
        pass

    # With a custom template
    @sentry_sdk.trace(template=SPANTEMPLATE.AI_TOOL)
    def calculate_interest_rate(amount, rate, years):
        # Function implementation
        pass
)create_span_decorator)r4   r?   rb  rc  )sentry_sdk.tracing_utilsrl  )re  r4   r?   rb  rc  rl  	decorators   &$$$$  rE   r  r  9  s3    T ?%	I rH   )rY   r  r  r!  r  r  rl   )Nr   r   r   r   r   enumr   typingr   r   sentry_sdk.constsr   r	   r
   r   'sentry_sdk.profiler.continuous_profilerr   sentry_sdk.utilsr   r   r   r   r   r   collections.abcr   r   r   r   r   r   r   r   r   r   r   r   r   r    typing_extensionsr!   r"   r#   r$   sentry_sdk._typesr%   r&   r'   r(   r)   (sentry_sdk.profiler.transaction_profilerr*   r,   rU   rA   r\   r  r"  r_   rv   LOW_QUALITY_TRANSACTION_SOURCESrr   rt   SOURCE_FOR_STYLEr   r   r   r  r  DEFAULTr  rm  rY   r  r  r!  r  r  rI   rH   rE   <module>r{     s7     2 2     N N C  AA    4#AA  J@9aYe 9avQJe Q 3	
N   ) 
	T 	 # 
 !++&00%//066
!!#--&,,%++	""
 #$L$ $.W0 W0tU$ UpNt Nb 	 #	 !%		
 26	 $0#7#7	 	  
V V !	V
 .2V  ,33V Vv  rH   