§
    xÅjýË  ã            
       ó‚  — d dl Z d dlZd dlmZmZmZ d dlmZ d dlmZm	Z	 d dl
Z
d dlmZmZmZmZ d dlmZ d dlmZmZmZmZmZmZ er†d dlmZmZmZ d d	lmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z& d d
l'm(Z(m)Z)  e"d¦  «        Z* e$d¦  «        Z+d dl,m-Z-m.Z.m/Z/m0Z0 d dlm1Z1 d dl2m3Z3  G d„ de(d¬¦  «        Z4 G d„ de4d¬¦  «        Z5 e(dde6i¦  «        Z7dZ8dZ9 G d„ de6e¦  «        Z:e:j;        gZ<e:j=        e:j=        e:j=        e:j>        e:j;        e:j=        e:j>        e:j>        e:j>        dœ	Z?de@de6fd„ZA G d „ d!¦  «        ZB G d"„ d#¦  «        ZC G d$„ d%eC¦  «        ZD G d&„ d'eC¦  «        ZEer0e&	 d9dddejF        d(œ	 	 	 	 	 	 	 	 	 	 	 d:d2„¦   «         ZGe&d;d4„¦   «         ZG	 d9dddejF        d(œ	 	 	 	 	 	 	 	 	 	 	 d<d7„ZGd d8lHmIZImJZJmKZKmLZLmMZMmNZN dS )=é    N)ÚdatetimeÚ	timedeltaÚtimezone)ÚEnum)ÚTYPE_CHECKINGÚcast)Ú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ÚTupleÚTypeVarÚUnionÚoverload)Ú	TypedDictÚUnpackÚPÚR)ÚEventÚMeasurementUnitÚMeasurementValueÚSamplingContext)ÚContinuousProfile)ÚProfilec                   ó¶   — e Zd ZU eed<   	 eed<   	 eed<   	 eed<   	 eed<   	 eed<   	 eed<   	 ded	<   	 eed
<   	 ded<   	 ded<   	 ded<   	 eed<   	 eed<   dS )Ú
SpanKwargsÚ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ÚnameN©Ú__name__Ú
__module__Ú__qualname__ÚstrÚ__annotations__Úbool© ó    úCC:\Projects\Historical\venv\Lib\site-packages\sentry_sdk/tracing.pyr,   r,   0   sã   € € € € € € Øˆˆ‰ð	ð
 ˆˆ‰ØTàÐÐÑØ<à $Ð$Ð$Ñ$ØJàˆˆ‰ð	ð
 ˆˆ‰ð	ð
 ÐÐÑð 	Yà'Ð'Ð'Ñ'Øsàˆˆ‰Ørà 7Ð7Ð7Ñ7Ø8à;Ð;Ð;Ñ;ð	ð
 "Ð!Ð!Ñ!ØXàˆˆ‰ð	ð ˆ	ˆ	‰	Ø`Ð`rF   r,   F)Útotalc                   ó2   — e Zd ZU eed<   	 eed<   	 ded<   dS )ÚTransactionKwargsÚsourceÚparent_sampledÚBaggageÚbaggageNr>   rE   rF   rG   rJ   rJ   k   s=   € € € € € € Øˆˆ‰ð	ð ÐÐÑØàÐÐÑØPÐPrF   rJ   ÚProfileContextÚprofiler_idrN   zsentry-tracec                   ó2   — e Zd ZdZdZdZdZdZdZde	fd„Z
d	S )
ÚTransactionSourceÚ	componentÚcustomÚrouteÚtaskÚurlÚviewÚreturnc                 ó   — | j         S ©N)Úvalue©Úselfs    rG   Ú__str__zTransactionSource.__str__Ž   s
   € ØŒzÐrF   N)r?   r@   rA   Ú	COMPONENTÚCUSTOMÚROUTEÚTASKÚURLÚVIEWrB   r_   rE   rF   rG   rR   rR   †   sM   € € € € € Ø€IØ€FØ€EØ€DØ
€CØ€Dð˜ð ð ð ð ð ð rF   rR   )	ÚendpointÚfunction_nameÚhandler_nameÚmethod_and_path_patternÚpathÚ
route_nameÚroute_patternÚuri_templaterW   Úhttp_status_coderY   c                 óò  — | dk     rt           j        S d| cxk    rdk     r{n nx| dk    rt           j        S | dk    rt           j        S | dk    rt           j        S | dk    rt           j        S | dk    rt           j        S | dk    rt           j        S t           j        S d| cxk    rd	k     rEn nB| d
k    rt           j	        S | dk    rt           j
        S | dk    rt           j        S t           j        S t           j        S )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)rn   s    rG   Úget_span_status_from_http_coder}   ¤   s,  € ð ˜#ÒÐÝŒ}Ðà	Ð Ð	&Ð	&Ò	&Ð	& 3Ò	&Ð	&Ð	&Ð	&Ð	&Ø˜sÒ"Ð"ÝÔ/Ð/Ø Ò$Ð$ÝÔ'Ð'Ø Ò$Ð$ÝÔ0Ð0Ø Ò$Ð$ÝÔ1Ð1Ø Ò$Ð$ÝÔ-Ð-Ø Ò$Ð$ÝÔ,Ð,åÔ.Ð.à	Ð Ð	&Ð	&Ò	&Ð	& 3Ò	&Ð	&Ð	&Ð	&Ð	&Ø˜sÒ"Ð"ÝÔ/Ð/Ø Ò$Ð$ÝÔ+Ð+Ø Ò$Ð$ÝÔ)Ð)åÔ,Ð,åÔ#Ð#rF   c                   ó.   — e Zd ZdZdZdeddfd„Zd
d	„ZdS )Ú_SpanRecorderz5Limits the number of spans recorded in a transaction.©ÚmaxlenÚspansÚdropped_spansr�   rY   Nc                 ó6   — |dz
  | _         g | _        d| _        d S )Né   r   r€   ©r^   r�   s     rG   Ú__init__z_SpanRecorder.__init__Ï   s$   € ð ˜q‘jˆŒØ#%ˆŒ
Ø"#ˆÔÐÐrF   ÚspanÚSpanc                 ó¦   — t          | j        ¦  «        | j        k    rd |_        | xj        dz  c_        d S | j                             |¦  «         d S )Nr…   )Úlenr‚   r�   Ú_span_recorderrƒ   Úappend)r^   rˆ   s     rG   Úaddz_SpanRecorder.addÙ   sU   € ÝˆtŒz‰?Œ?˜Tœ[Ò(Ð(Ø"&ˆDÔØÐÔ !Ñ#ÐÔÐÐàŒJ×Ò˜dÑ#Ô#Ð#Ð#Ð#rF   )rˆ   r‰   rY   N)r?   r@   rA   Ú__doc__Ú	__slots__Úintr‡   rŽ   rE   rF   rG   r   r   Ê   sU   € € € € € Ø?Ð?à4€Ið$˜sð $ tð $ð $ð $ð $ð$ð $ð $ð $ð $ð $rF   r   c                   óú  — e Zd ZdZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 d\ddddd	dd
edddddddddddddddddeddddfd„Zdeddfd„Z	e
defd„¦   «         Zej        deddfd „¦   «         Ze
defd!„¦   «         Zej        deddfd"„¦   «         Zdefd#„Zd]d$„Z	 	 	 	 	 	 	 	 d^d(„Ze
d_d)„¦   «         Zej        fd*ed+d,dd fd-„Ze	 	 	 	 	 	 d`d1„¦   «         Zedd2œ	 	 	 	 	 	 	 dad5„¦   «         Zdbd7„Ze	 	 	 	 	 	 dcd9„¦   «         Zdefd:„Zddd<„Zd=edd,ddfd>„Zd=edd,ddfd?„ZdedB„ZdCedDeddfdE„ZdeddfdF„Z 	 dfdede!dHdIddfdJ„Z"	 	 	 	 	 	 dgdN„Z#dhdP„Z$dQeddfdR„Z%defdS„Z&	 	 di	 	 	 	 	 djdV„Z'dkdW„Z(dldX„Z)dmdZ„Z*dnd[„Z+eZ,eZ-eZ.e)Z/dS )or‰   ak  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.
    )Ú	_trace_idÚ_span_idr/   r0   r1   r2   r3   Ú_measurementsr:   Ú_start_timestamp_monotonic_nsr6   Ú	timestampÚ_tagsÚ_datarŒ   r5   Ú_context_manager_stateÚ_containing_transactionr;   r<   r=   Ú_flagsÚ_flags_capacityNTÚmanualr-   úOptional[str]r.   r/   r0   r1   úOptional[bool]r2   r3   r5   r4   r6   r8   r7   r:   r9   r;   úOptional[sentry_sdk.Scope]r<   r=   rY   c                 óâ  — || _         || _        || _        || _        || _        || _        |p|| _        |	| _        || _        || _	        || _
        i | _        i | _        i | _        |
| _        i | _        d| _        |�/t#          j        dt&          d¬¦  «         | j	        p|j	        | _	        |€t)          j        t,          j        ¦  «        }n4t1          |t2          ¦  «        rt)          j        |t,          j        ¦  «        }|| _        	 t9          ¦   «         | _        n# t<          $ r Y nw xY wd | _        d | _         |  !                    ¦   «          |  "                    tG          ¦   «         ¦  «         d S )Né
   z>The `hub` parameter is deprecated. Please use `scope` instead.é   ©Ú
stacklevel)$r“   r”   r/   r0   r1   r2   r3   r6   r5   r;   r<   r•   r˜   r™   r›   rœ   r�   ÚwarningsÚwarnÚDeprecationWarningr   Únowr   ÚutcÚ
isinstanceÚfloatÚfromtimestampr:   r   r–   ÚAttributeErrorr—   rŒ   Úupdate_active_threadÚset_profiler_idr   )r^   r-   r.   r/   r0   r1   r2   r3   r5   r6   r8   r:   r;   r<   r=   s                  rG   r‡   zSpan.__init__  sƒ  € ð" "ˆŒØˆŒØ,ˆÔØ&<ˆÔ#ØˆŒØˆŒØÐ. ;ˆÔØˆŒØˆŒØˆŒ
ØˆŒØ<>ˆÔØ13ˆŒ
Ø')ˆŒ
Ø'=ˆÔ$Ø)+ˆŒØ!ˆÔàˆ?ÝŒMØPÝ"Øðñ ô ð ð œÐ0 s¤yˆDŒJàÐ"Ý&œl­8¬<Ñ8Ô8ˆOˆOÝ˜­Ñ/Ô/ð 	TÝ&Ô4°_ÅhÄlÑSÔSˆOØ.ˆÔð	õ 2AÑ1BÔ1BˆDÔ.Ð.øÝð 	ð 	ð 	ØˆDð	øøøð 04ˆŒà9=ˆÔà×!Ò!Ñ#Ô#Ð#Ø×Ò�_Ñ.Ô.Ñ/Ô/Ð/Ð/Ð/s   ÄD Ä
D)Ä(D)r�   c                 ó@   — | j         €t          |¦  «        | _         d S d S r[   )rŒ   r   r†   s     rG   Úinit_span_recorderzSpan.init_span_recorder[  s)   € ØÔÐ&Ý"/°Ñ"7Ô"7ˆDÔÐÐð 'Ð&rF   c                 óX   — | j         st          j        ¦   «         j        | _         | j         S r[   )r“   ÚuuidÚuuid4Úhexr]   s    rG   r-   zSpan.trace_id_  s$   € àŒ~ð 	.Ý!œZ™\œ\Ô-ˆDŒNàŒ~ÐrF   r\   c                 ó   — || _         d S r[   )r“   ©r^   r\   s     rG   r-   zSpan.trace_idf  s   € àˆŒˆˆrF   c                 óh   — | j         s%t          j        ¦   «         j        dd …         | _         | j         S )Né   )r”   rµ   r¶   r·   r]   s    rG   r.   zSpan.span_idj  s-   € àŒ}ð 	2Ý œJ™LœLÔ,¨R¨S¨SÔ1ˆDŒMàŒ}ÐrF   c                 ó   — || _         d S r[   )r”   r¹   s     rG   r.   zSpan.span_idq  s   € àˆŒˆˆrF   c                 ó’   — d| j         j        ›d| j        ›d| j        ›d| j        ›d| j        ›d| j        ›d| j        ›d| j        ›d	�S )
Nú<z(op=z, description:ú, trace_id=ú
, span_id=ú, parent_span_id=ú
, sampled=ú	, origin=ú)>)	Ú	__class__r?   r2   r3   r-   r.   r/   r1   r<   r]   s    rG   Ú__repr__zSpan.__repr__u  sc   € € ð ”Ô'Ð'Ð'Ø”��ØÔ Ð Ð Ø”��Ø”��ØÔ#Ð#Ð#Ø”��Ø”��ð
ð	
rF   c                 óÄ   — t          t          j        ¦   «         j        ¦  «        r	d | _        | S | j        pt          j        ¦   «         }|j        }| |_        ||f| _        | S r[   )Úhas_span_streaming_enabledÚ
sentry_sdkÚ
get_clientÚoptionsrš   r;   Úget_current_scoperˆ   )r^   r;   Úold_spans      rG   Ú	__enter__zSpan.__enter__„  s`   € Ý%¥jÔ&;Ñ&=Ô&=Ô&EÑFÔFð 	Ø*.ˆDÔ'ØˆKà”
Ð<�jÔ:Ñ<Ô<ˆØ”:ˆØˆŒ
Ø',¨hÐ&7ˆÔ#ØˆrF   ÚtyúOptional[Any]Útbc                 óX  — t          | d¦  «        r| j        €| `d S |�/t          ||¦  «        r|                      t          j        ¦  «         t          ¦   «         5  t          d| j        ¦  «        \  }}| `|                      |¦  «         ||_	        d d d ¦  «         d S # 1 swxY w Y   d S )Nrš   z'Tuple[sentry_sdk.Scope, Optional[Span]])
Úhasattrrš   r   Ú
set_statusr   r{   r   r   Úfinishrˆ   )r^   rÏ   r\   rÑ   r;   rÍ   s         rG   Ú__exit__zSpan.__exit__�  s  € õ �DÐ2Ñ3Ô3ð	àÔ+Ð3àÐ+ØˆFàÐÕ!;¸BÀÑ!FÔ!FÐØ�OŠO�JÔ5Ñ6Ô6Ð6å(Ñ*Ô*ð 	"ð 	"Ý"Ø9ØÔ+ñô ‰OˆE�8ð Ð+Ø�KŠK˜ÑÔÐØ!ˆEŒJð	"ð 	"ð 	"ñ 	"ô 	"ð 	"ð 	"ð 	"ð 	"ð 	"ð 	"ð 	"øøøð 	"ð 	"ð 	"ð 	"ð 	"ð 	"s   Á7BÂB#Â&B#c                 ó   — | j         S )z´The ``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›   r]   s    rG   r8   zSpan.containing_transaction¥  s   € ð Ô+Ð+rF   ÚinstrumenterÚkwargsr   c                 ó”  — |                      d¦  «        �t          j        dt          d¬¦  «         t	          j        ¦   «         j        d         }||k    rt          ¦   «         S |                     d| j	        ¦  «         t          d	| j        | j        | j        dœ|¤Ž}| j        o| j        j        }|r|                     |¦  «         |S )
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.
        r3   NzEThe `description` parameter is deprecated. Please use `name` instead.r¤   r¥   rØ   r1   )r-   r/   r8   rE   )Úgetr§   r¨   r©   rÉ   rÊ   rË   ÚNoOpSpanÚ
setdefaultr1   r‰   r-   r.   r8   rŒ   rŽ   )r^   rØ   rÙ   Úconfiguration_instrumenterÚchildÚspan_recorders         rG   Ústart_childzSpan.start_child°  sí   € ð �:Š:�mÑ$Ô$Ð0ÝŒMØWÝ"Øðñ ô ð õ &0Ô%:Ñ%<Ô%<Ô%DÀ^Ô%TÐ"àÐ5Ò5Ð5Ý‘:”:Ðà×Ò˜) T¤\Ñ2Ô2Ð2åð 
Ø”]Øœ<Ø#'Ô#>ð
ð 
ð ð	
ð 
ˆð Ô'ÐV¨DÔ,GÔ,Vð 	ð ð 	%Ø×Ò˜eÑ$Ô$Ð$àˆrF   ÚenvironúMapping[str, str]ÚTransactionc                 ó@   — t          j        t          |¦  «        fi |¤ŽS )ag  
        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      rG   Úcontinue_from_environzSpan.continue_from_environÛ  s%   € õ( Ô0µÀÑ1HÔ1HÐSÐSÈFÐSÐSÐSrF   ©Ú_sample_randÚheadersrë   c                óŒ  — t          j        d¦  «         t          j        |                     t
          ¦  «        |¬¦  «        }|                     t
          |i¦  «         t          |                     t          ¦  «        ¦  «        }|�)|                     |¦  «         | 	                    ¦   «          t          di |¤Ž}d|_        |S )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ê   NFrE   )r   ÚwarningrM   Úfrom_incoming_headerrÛ   ÚBAGGAGE_HEADER_NAMEÚupdateÚextract_sentrytrace_dataÚSENTRY_TRACE_HEADER_NAMEÚfreezerä   r0   )rè   rì   rë   rÙ   rN   Úsentrytrace_kwargsÚtransactions          rG   ræ   zSpan.continue_from_headersñ  sÈ   € õ$ 	ŒÐKÑLÔLÐLõ Ô.Ø�KŠKÕ+Ñ,Ô,¸<ð
ñ 
ô 
ˆð 	�ŠÕ*¨GÐ4Ñ5Ô5Ð5å5Ø�KŠKÕ0Ñ1Ô1ñ
ô 
Ðð Ð)Ø�MŠMÐ,Ñ-Ô-Ð-ð
 �NŠNÑÔÐå!Ð+Ð+ FÐ+Ð+ˆØ-2ˆÔ*àÐrF   úIterator[Tuple[str, str]]c              #   óÊ   K  — | j         sdS t          |                      ¦   «         fV — | j                              ¦   «                              ¦   «         }|rt
          |fV — dS dS )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)r8   ró   Úto_traceparentÚget_baggageÚ	serializerð   )r^   rN   s     rG   Úiter_headerszSpan.iter_headers  s€   è è € ð Ô*ð 	ð
 ˆFå&¨×(;Ò(;Ñ(=Ô(=Ð=Ð=Ð=Ð=àÔ-×9Ò9Ñ;Ô;×EÒEÑGÔGˆØð 	/Ý% wÐ.Ð.Ð.Ð.Ð.Ð.ð	/ð 	/rF   Útraceparentc                 ó4   — |sdS  | j         t          |ifi |¤ŽS )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è   rý   rÙ   s      rG   Úfrom_traceparentzSpan.from_traceparent0  s=   € ð ð 	Ø�4à(ˆsÔ(Ý% {Ð3ð
ð 
Ø7=ð
ð 
ð 	
rF   c                 óp   — | j         du rd}n| j         du rd}nd }| j        ›d| j        ›�}|�|d|›�z  }|S )NTÚ1FÚ0ú-)r1   r-   r.   )r^   r1   rý   s      rG   rù   zSpan.to_traceparentC  s`   € ØŒ<˜4ÐÐØˆGˆGØŒ\˜UÐ"Ð"ØˆGˆGàˆGà!%¤  °´°Ð=ˆØÐØˆK G GÐ-Ñ-ˆKàÐrF   úOptional[Baggage]c                 óF   — | j         r| j                              ¦   «         S dS )z™Returns the :py:class:`~sentry_sdk.tracing_utils.Baggage`
        associated with this ``Span``, if any. (Taken from the root of the span tree.)
        N)r8   rú   r]   s    rG   Ú
to_baggagezSpan.to_baggageQ  s)   € ð Ô&ð 	=ØÔ.×:Ò:Ñ<Ô<Ð<ØˆtrF   Úkeyc                 ó   — || j         |<   d S r[   )r˜   ©r^   r  r\   s      rG   Úset_tagzSpan.set_tagY  ó   € ØˆŒ
�3‰ˆˆrF   c                 ó   — || j         |<   d S r[   )r™   r	  s      rG   Úset_datazSpan.set_data\  r  rF   ÚdataúDict[str, Any]c                 ó:   — | j                              |¦  «         d S r[   )r™   rñ   ©r^   r  s     rG   Úupdate_datazSpan.update_data_  s   € ØŒ
×Ò˜$ÑÔÐÐÐrF   ÚflagÚresultc                 óX   — t          | j        ¦  «        | j        k     r|| j        |<   d S d S r[   )r‹   rœ   r�   )r^   r  r  s      rG   Úset_flagzSpan.set_flagb  s4   € ÝˆtŒ{ÑÔ˜dÔ2Ò2Ð2Ø &ˆDŒK˜ÑÐÐð 3Ð2rF   c                 ó   — || _         d S r[   ©r6   r¹   s     rG   rÔ   zSpan.set_statusf  s   € ØˆŒˆˆrF   Ú Úunitr&   c                 óX   — t          j        dt          d¬¦  «         ||dœ| j        |<   dS ©z
        .. 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¤   r¥   )r\   r  N©r§   r¨   r©   r•   ©r^   r=   r\   r  s       rG   Úset_measurementzSpan.set_measurementi  óC   € õ 	ŒØÝØð	
ñ 	
ô 	
ð 	
ð
 .3¸DÐ#AÐ#AˆÔ˜4Ñ Ð Ð rF   Ú	thread_idúOptional[int]Úthread_namec                 ó°   — |�Q|                       t          j        t          |¦  «        ¦  «         |�$|                       t          j        |¦  «         d S d S d S r[   )r  r
   Ú	THREAD_IDrB   ÚTHREAD_NAME©r^   r!  r#  s      rG   Ú
set_threadzSpan.set_threadx  sZ   € ð Ð Ø�MŠM�(Ô,­c°)©n¬nÑ=Ô=Ð=àÐ&Ø—’�hÔ2°KÑ@Ô@Ð@Ð@Ð@ð	 !Ð ð 'Ð&rF   rP   c                 óN   — |�"|                       t          j        |¦  «         d S d S r[   )r  r
   ÚPROFILER_ID©r^   rP   s     rG   r±   zSpan.set_profiler_id�  s-   € ØÐ"Ø�MŠM�(Ô.°Ñ<Ô<Ð<Ð<Ð<ð #Ð"rF   Úhttp_statusc                 óÐ   — |                       dt          |¦  «        ¦  «         |                      t          j        |¦  «         |                      t          |¦  «        ¦  «         d S )Nzhttp.status_code)r
  rB   r  r
   ÚHTTP_STATUS_CODErÔ   r}   ©r^   r,  s     rG   Úset_http_statuszSpan.set_http_status…  s_   € Ø�ŠØ¥ KÑ 0Ô 0ñ	
ô 	
ð 	
ð 	�Š•hÔ/°Ñ=Ô=Ð=Ø�ŠÕ6°{ÑCÔCÑDÔDÐDÐDÐDrF   c                 ó   — | j         dk    S )NÚokr  r]   s    rG   Ú
is_successzSpan.is_successŒ  s   € ØŒ{˜dÒ"Ð"rF   Úend_timestampú Optional[Union[float, datetime]]c                 ó”  — | j         �dS 	 |r<t          |t          ¦  «        rt          j        |t
          j        ¦  «        }|| _         n6t          ¦   «         | j        z
  }| j	        t          |dz  ¬¦  «        z   | _         n3# t          $ r& t          j        t
          j        ¦  «        | _         Y nw xY w|pt          j        ¦   «         }|                     ¦   «         }|rjt           j        | j        v }| j        duo3| j                             d¦  «        p| j                             d¦  «        }|s|r|                      d|¦  «         dS )aD  
        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è  )Úmicrosecondszai.úgen_ai.zgen_ai.conversation.id)r—   r¬   r­   r   r®   r   r«   r   r–   r:   r   r¯   rª   rÉ   rÌ   Úget_conversation_idr
   ÚGEN_AI_OPERATION_NAMEr™   r2   Ú
startswithr  )r^   r;   r4  ÚelapsedÚconversation_idÚ	has_ai_opÚis_ai_span_ops          rG   rÕ   zSpan.finish�  sf  € ð& Œ>Ð%à�4ð	8Øð Ý˜m­UÑ3Ô3ð XÝ$,Ô$:¸=Í(Ì,Ñ$WÔ$W�MØ!.�”�å)Ñ+Ô+¨dÔ.PÑP�Ø!%Ô!5½	Ø!(¨4¡ð9ñ 9ô 9ñ "�”øøõ ð 	8ð 	8ð 	8Ý%œ\­(¬,Ñ7Ô7ˆDŒNˆNˆNð	8øøøð Ð7�Ô5Ñ7Ô7ˆð  ×3Ò3Ñ5Ô5ˆØð 	IÝ Ô6¸$¼*ÐDˆIØ œG¨4Ð/ð Ø”×"Ò" 5Ñ)Ô)ÐJ¨T¬W×-?Ò-?À	Ñ-JÔ-Jð ð ð I˜Mð IØ—’Ð6¸ÑHÔHÐHàˆts   ‹A4B  Â -B0Â/B0c           
      ó’  — | j         | j        | j        | j        | j        | j        | j        | j        | j        dœ	}| j	        r| j	        |d<   | j	        | j
        d<   t          | j        ¦  «        dk    r
| j        |d<   | j
        }|r||d<   i }|                     | j        ¦  «         |                     | j        ¦  «         |r||d<   |S )z5Returns a JSON-compatible representation of the span.)	r-   r.   r/   r0   r2   r3   r:   r—   r<   r6   r   ÚmeasurementsÚtagsr  )r-   r.   r/   r0   r2   r3   r:   r—   r<   r6   r˜   r‹   r•   rñ   rœ   r™   )r^   ÚrvrB  r  s       rG   Úto_jsonzSpan.to_jsonÁ  sä   € ð œØ”|Ø"Ô1Ø&*Ô&AØ”'ØÔ+Ø#Ô3ØœØ”kð
 
ð 
 
ˆð Œ;ð 	/Øœ;ˆBˆx‰Là#'¤;ˆDŒJ�xÑ åˆtÔ!Ñ"Ô" QÒ&Ð&Ø!%Ô!3ˆBˆ~ÑàŒzˆØð 	ØˆBˆv‰JàˆØ�Š�D”KÑ Ô Ð Ø�Š�D”JÑÔÐØð 	ØˆBˆv‰Jàˆ	rF   c                 óž  — | j         | j        | j        | j        | j        | j        dœ}| j        r
| j        |d<   | j        r.| j                             ¦   «          	                    ¦   «         |d<   i }| j
                             t          j        ¦  «        }|�||d<   | j
                             t          j        ¦  «        }|�||d<   |r||d<   |S )N)r-   r.   r/   r2   r3   r<   r6   Údynamic_sampling_contextz	thread.idzthread.namer  )r-   r.   r/   r2   r3   r<   r6   r8   rú   rF  r™   rÛ   r
   r%  r&  )r^   rC  r  r!  r#  s        rG   Úget_trace_contextzSpan.get_trace_contextä  sâ   € àœØ”|Ø"Ô1Ø”'ØÔ+Ø”kð 
ð  
ˆð Œ;ð 	'Øœ;ˆBˆx‰LàÔ&ð 	àÔ+×7Ò7Ñ9Ô9×RÒRÑTÔTð Ð)Ñ*ð ˆà”J—N’N¥8Ô#5Ñ6Ô6ˆ	ØÐ Ø )ˆD�Ñà”j—n’n¥XÔ%9Ñ:Ô:ˆØÐ"Ø"-ˆD�Ñàð 	ØˆBˆv‰Jàˆ	rF   úOptional[ProfileContext]c                 óZ   — | j                              t          j        ¦  «        }|€d S d|iS )NrP   )r™   rÛ   r
   r*  r+  s     rG   Úget_profile_contextzSpan.get_profile_context  s4   € Ø”j—n’n¥XÔ%9Ñ:Ô:ˆØÐØ�4ð ˜;ð
ð 	
rF   c                 óT   — t          ¦   «         \  }}|                      ||¦  «         d S r[   )r   r(  r'  s      rG   r°   zSpan.update_active_thread  s,   € Ý!8Ñ!:Ô!:Ñˆ	�;Ø�Š˜	 ;Ñ/Ô/Ð/Ð/Ð/rF   )NNNTNNNNNNNNrž   N)rY   r‰   ©rÏ   rÐ   r\   rÐ   rÑ   rÐ   rY   N©rY   r7   )râ   rã   rÙ   r   rY   rä   )rì   rã   rë   rŸ   rÙ   r   rY   rä   ©rY   r÷   )rý   rŸ   rÙ   r   rY   r7   ©rY   r  ©r  r  rY   N©r  )r!  r"  r#  rŸ   rY   N)rP   rŸ   rY   N©NN)r;   r¡   r4  r5  rY   rŸ   ©rY   r  ©rY   r   )rY   rH  )rY   N)0r?   r@   rA   r�   r�   rD   rB   r‡   r‘   r³   Úpropertyr-   Úsetterr.   rÆ   rÎ   rÖ   r8   r	   ÚSENTRYrá   Úclassmethodré   ræ   rü   rÿ   rù   r  r
  r  r  r  rÔ   r­   r  r(  r±   r0  r3  rÕ   rD  rG  rJ  r°   Ú_to_traceparentÚ_to_baggageÚ_iter_headersÚ_get_trace_contextrE   rF   rG   r‰   r‰   á   sÁ  € € € € € ðð ð:€Ið8 %)Ø#'Ø*.Ø'+Ø$(Ø"Ø'+Ø*.Ø"&Ø:>Ø>BØ.2ØØ $ð>0ð >0à!ð>0ð !ð>0ð (ð	>0ð
 !%ð>0ð "ð>0ð ð>0ð %ð>0ð (ð>0ð  ð>0ð !8ð>0ð <ð>0ð ,ð>0ð ð>0ð ð>0ð  
ð!>0ð >0ð >0ð >0ðD8¨ð 8°ð 8ð 8ð 8ð 8ð ð˜#ð ð ð ñ „Xðð „_ð˜cð  dð ð ð ñ „_ðð ð˜ð ð ð ñ „Xðð „^ð˜Sð  Tð ð ð ñ „^ðð
˜#ð 
ð 
ð 
ð 
ð	ð 	ð 	ð 	ð"Ø!ð"Ø*9ð"Ø?Nð"à	ð"ð "ð "ð "ð, ð,ð ,ð ,ñ „Xð,ð #/Ô"5ð)ð )Øð)ØAFð)à	ð)ð )ð )ð )ðV ðTà$ðTð ðTð 
ð	Tð Tð Tñ „[ðTð* ð
 )-ð	)ð )à$ð)ð &ð	)ð
 ð)ð 
ð)ð )ð )ñ „[ð)ðV/ð /ð /ð /ð& ð
à$ð
ð ð
ð 
!ð	
ð 
ð 
ñ „[ð
ð$ ð ð ð ð ðð ð ð ð ˜3ð   uð  °ð  ð  ð  ð  ð ˜Cð  ¨ð  °$ð  ð  ð  ð  ð ð  ð  ð  ð'˜Sð '¨$ð '°4ð 'ð 'ð 'ð 'ð ð ¨ð ð ð ð ð BDðBð BØðBØ %ðBØ->ðBà	ðBð Bð Bð BðAØ(ðAØ7FðAà	ðAð Að Að Að=ð =ð =ð =ðE¨3ð E°4ð Eð Eð Eð Eð#˜Dð #ð #ð #ð #ð
 /3Ø<@ð0à+ð0ð :ð0ð 
ð	0ð 0ð 0ð 0ðd!ð !ð !ð !ðFð ð ð ð@
ð 
ð 
ð 
ð0ð 0ð 0ð 0ð
 %€OØ€KØ €MØ*ÐÐÐrF   r‰   c                   ón  ‡ — e Zd ZdZdZdddej        fdedddd	d
eddddfˆ fd„Zdefd„Z	de
fd„Zd7ˆ fd„Z	 	 	 	 	 	 	 	 d8ˆ fd„Zed7d„¦   «         Z	 	 	 	 	 	 d9d„Zdefd„Z	 	 d:ddœ	 	 	 	 	 	 	 d;ˆ fd%„Z	 d<deded&d'ddfd(„Zd)edd*ddfd+„Zd,eddfˆ fd-„Zd=ˆ fd/„Zd>ˆ fd1„Zd?d3„Z	 	 	 	 d@d6„ZeZeZˆ xZS )Arä   ai  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=   rK   rL   Úsample_rater•   Ú	_contextsÚ_profileÚ_continuous_profileÚ_baggagerë   r  Nr=   rL   r    rN   r  rK   rÙ   zUnpack[SpanKwargs]rY   c                 óD  •—  t          ¦   «         j        di |¤Ž || _        || _        d | _        || _        i | _        i | _        d | _        d | _	        || _
        | j
        €d n| j
                             ¦   «         }|�	|| _        d S t          | j        ¦  «        | _        d S ©NrE   )Úsuperr‡   r=   rK   r^  rL   r•   r_  r`  ra  rb  rë   Ú_generate_sample_randr-   )r^   r=   rL   rN   rK   rÙ   Úbaggage_sample_randrÅ   s          €rG   r‡   zTransaction.__init__8  s¶   ø€ ð 	�‰ŒÔÐ"Ð"˜6Ð"Ð"Ð"àˆŒ	ØˆŒØ.2ˆÔØ,ˆÔØ<>ˆÔØ+-ˆŒØ-1ˆŒØBFˆÔ ØˆŒð ”MÐ)ˆDˆD¨t¬}×/IÒ/IÑ/KÔ/Kð 	ð Ð*Ø 3ˆDÔÐÐå 5°d´mÑ DÔ DˆDÔÐÐrF   c                 ó¢   — d| j         j        ›d| j        ›d| j        ›d| j        ›d| j        ›d| j        ›d| j        ›d| j        ›d	| j	        ›d
�S )Nr¾   z(name=z, op=r¿   rÀ   rÁ   rÂ   z	, source=rÃ   rÄ   )
rÅ   r?   r=   r2   r-   r.   r/   r1   rK   r<   r]   s    rG   rÆ   zTransaction.__repr__T  si   € € ð ”Ô'Ð'Ð'Ø”	�	�	Ø”��Ø”��Ø”��ØÔ#Ð#Ð#Ø”��Ø”��Ø”��ðð	
rF   c                 ó&   — | j         dup| j        du S )zòReturns 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Œ   r1   r]   s    rG   Ú_possibly_startedzTransaction._possibly_startedd  s   € ð Ô"¨$Ð.ÐG°$´,À%Ð2GÐGrF   c                 óØ   •— |                       ¦   «         st          j        d¦  «         t          ¦   «                              ¦   «          | j        �| j                             ¦   «          | S )NzÇTransaction 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.)rj  r   Údebugre  rÎ   r`  )r^   rÅ   s    €rG   rÎ   zTransaction.__enter__o  si   ø€ Ø×%Ò%Ñ'Ô'ð 	ÝŒLð>ñô ð õ 	‰Œ×ÒÑÔÐàŒ=Ð$ØŒM×#Ò#Ñ%Ô%Ð%àˆrF   rÏ   rÐ   r\   rÑ   c                 óÔ   •— | j         �| j                              |||¦  «         | j        �| j                             ¦   «          t	          ¦   «                              |||¦  «         d S r[   )r`  rÖ   ra  Ústopre  )r^   rÏ   r\   rÑ   rÅ   s       €rG   rÖ   zTransaction.__exit__~  sg   ø€ ð Œ=Ð$ØŒM×"Ò" 2 u¨bÑ1Ô1Ð1àÔ#Ð/ØÔ$×)Ò)Ñ+Ô+Ð+å‰Œ×Ò˜˜U BÑ'Ô'Ð'Ð'Ð'rF   c                 ó   — | S )znThe root element of the span tree.
        In the case of a transaction it is the transaction itself.
        rE   r]   s    rG   r8   z"Transaction.containing_transaction‰  s	   € ð ˆrF   Ú	scope_argú1Optional[Union[sentry_sdk.Scope, sentry_sdk.Hub]]Úhub_argr¡   c                 óÄ   — |}|�t          j        dt          d¬¦  «         |}t          |t          j        ¦  «        r#t          j        dt          d¬¦  «         |j        S |S )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.
        NzMThe `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;   )r^   rp  rr  Úscope_or_hubs       rG   Ú_get_scope_from_finish_argsz'Transaction._get_scope_from_finish_args”  s   € ð !ˆØÐÝŒMØ_Ý"Øðñ ô ð ð #ˆLå�l¥J¤NÑ3Ô3ð 	&ÝŒMØVÝ"Øðñ ô ð ð  Ô%Ð%àÐrF   c                 ób   — d                      | j        rd| j        z   dz   nd| j        ¬¦  «        S )Nz{op}transaction <{name}>r¾   z> r  )r2   r=   )Úformatr2   r=   r]   s    rG   Ú_get_log_representationz#Transaction._get_log_representation´  s=   € Ø)×0Ò0Ø(,¬Ð7��d”g‘ Ñ$Ð$°R¸t¼yð 1ñ 
ô 
ð 	
rF   ©r5   r;   r4  r5  r5   r4   rŸ   c          	      óž  •— | j         �dS |                      ||¦  «        }|p| j        pt          j        ¦   «         }t          j        ¦   «         }|                     ¦   «         sdS | j        €£| j        du rt          j
        d¦  «         nt          j
        d¦  «         |j        rht          |j        ¦  «        rT|j        r|j        j        dk    rd}nd}|j                             |d¬	¦  «         |j                             |d
¬	¦  «         dS | j        st          j        d¦  «         d| _        t'          ¦   «                              ||¦  «         | j                             t.          j        ¦  «        }|�Î||j        d         v r¿t          j
        d                     |                      ¦   «         | j        t.          j                 |j        d         ¬¦  «        ¦  «         |j        rU|j                             dd¬	¦  «         t7          | j        j        ¦  «        dz   }|j                             dd
|¬¦  «         d| _        | j        s| j        €t          j        d¦  «         dS g }d}	|j                             dd¦  «        ru| j        j        D ]g}
|
j         €Œ
t;          |
j        t>          ¦  «        r|
j                              d¦  «        rd}	| !                    |
 "                    ¦   «         ¦  «         Œhnd„ | j        j        D ¦   «         }t7          | j        j        ¦  «        t7          |¦  «        z
  }|| j        j#        z   }d| _        i }| $                    | j%        ¦  «         | $                    d|  &                    ¦   «         i¦  «         |  '                    ¦   «         }|�| $                    d|i¦  «         d| j        d| j(        i|| j)        | j         | j*        |dœ}|dk    r||d<   |	rd|d<   | j+        �*| j+         ,                    ¦   «         r| j+        |d<   d| _+        | j-        |d<   | .                    |¦  «        S )au  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_transactionr   Ú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_processorr…   )r~  Úquantityz1Discarding transaction without sampling decision.Ústream_gen_ai_spansTr8  c                 óD   — g | ]}|j         ®	|                     ¦   «         ‘ŒS r[   )r—   rD  )Ú.0rˆ   s     rG   ú
<listcomp>z&Transaction.finish.<locals>.<listcomp>+  s2   € ð ð ð àØ”>Ð-ð —’‘”à-Ð-Ð-rF   ÚtraceÚprofilerK   )Útyperö   Útransaction_infoÚcontextsrB  r—   r:   r‚   Ú_dropped_spansÚ_has_gen_ai_spanrA  )/r—   rw  r;   rÉ   rÌ   rÊ   Ú	is_activerŒ   r1   r   rl  Ú	transportÚhas_tracing_enabledrË   ÚmonitorÚdownsample_factorÚrecord_lost_eventr=   rî   re  rÕ   r™   rÛ   r
   r.  ry  rz  r‹   r‚   r¬   r2   rB   r;  r�   rD  rƒ   rñ   r_  rG  rJ  rK   r˜   r:   r`  Úvalidr•   Úcapture_event)r^   r;   r4  r5   ÚclientÚreasonr�  Ú	num_spansÚfinished_spansÚhas_gen_ai_spanrˆ   Úlen_diffrƒ   rŒ  Úprofile_contextÚeventrÅ   s                   €rG   rÕ   zTransaction.finish¹  s¹  ø€ ð* Œ>Ð%à�4ð ×0Ò0°¸Ñ<Ô<ˆàÐE˜œÐE¥zÔ'CÑ'EÔ'EˆÝÔ&Ñ(Ô(ˆà×ÒÑ!Ô!ð 	à�4àÔÐ&àŒ|˜uÐ$Ð$Ý”ÐMÑNÔNÐNÐNå”Øiñô ð ð Ôð 	QÕ$7¸¼Ñ$GÔ$Gð 	QØ”>ð + f¤nÔ&FÈÒ&JÐ&JØ+�F�Fà*�FàÔ ×2Ò2°6ÈÐ2ÑWÔWÐWð Ô ×2Ò2°6ÈÐ2ÑPÔPÐPØ�4àŒyð 	2ÝŒNØUñô ð ð 2ˆDŒIå‰Œ�Š�u˜mÑ,Ô,Ð,à”j—n’n¥XÔ%>Ñ?Ô?ˆàÐ#Ø˜vœ~Ð.IÔJÐJÐJåŒLð q÷  xò  xØ,0×,HÒ,HÑ,JÔ,JØ $¤
­8Ô+DÔ EØ.4¬nØ3ô/ð xñ ô ñô ð ð Ôð ØÔ ×2Ò2Ø%°]ð 3ñ ô ð õ   Ô 3Ô 9Ñ:Ô:¸QÑ>�	ØÔ ×2Ò2Ø%°VÀið 3ñ ô ð ð !ˆDŒLàŒ|ð 	ð Œ|Ð#Ý”ÐRÑSÔSÐSà�4àˆØˆØŒ>×ÒÐ3°TÑ:Ô:ð 	ØÔ+Ô1ð 6ð 6�Ø”>Ð)Øå˜dœg¥sÑ+Ô+ð +°´×0BÒ0BÀ9Ñ0MÔ0Mð +Ø&*�Oà×%Ò% d§l¢l¡n¤nÑ5Ô5Ð5Ð5ð6ðð à Ô/Ô5ðñ ô ˆNõ �tÔ*Ô0Ñ1Ô1µC¸Ñ4GÔ4GÑGˆØ  4Ô#6Ô#DÑDˆð #ˆÔàˆØ�Š˜œÑ'Ô'Ð'Ø�Š˜ $×"8Ò"8Ñ":Ô":Ð;Ñ<Ô<Ð<Ø×2Ò2Ñ4Ô4ˆØÐ&Ø�OŠO˜Y¨Ð8Ñ9Ô9Ð9ð "Øœ9Ø!)¨4¬;Ð 7Ø Ø”JØœØ#Ô3Ø#ð	
ð 	
ˆð ˜1ÒÐØ&3ˆEÐ"Ñ#àð 	-Ø(,ˆEÐ$Ñ%àŒ=Ð$¨¬×)<Ò)<Ñ)>Ô)>Ð$Ø#œ}ˆE�)ÑØ ˆDŒMà $Ô 2ˆˆnÑà×"Ò" 5Ñ)Ô)Ð)rF   r  r&   c                 óX   — t          j        dt          d¬¦  «         ||dœ| j        |<   dS r  r  r  s       rG   r  zTransaction.set_measurementZ  r   rF   r  údict[str, Any]c                 ó   — || j         |<   dS )a  Sets 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_  r	  s      rG   Úset_contextzTransaction.set_contexti  s   € ð $ˆŒ�sÑÐÐrF   r,  c                 óz   •— t          ¦   «                              |¦  «         |                      dd|i¦  «         dS )zySets the status of the Transaction according to the given HTTP status.

        :param http_status: The HTTP status code.Úresponser�  N)re  r0  r¢  )r^   r,  rÅ   s     €rG   r0  zTransaction.set_http_statuss  s>   ø€ õ 	‰Œ×Ò Ñ,Ô,Ð,Ø×Ò˜ m°[Ð%AÑBÔBÐBÐBÐBrF   r  c                 ó„   •— t          ¦   «                              ¦   «         }| j        |d<   | j        |d<   | j        |d<   |S )z<Returns a JSON-compatible representation of the transaction.r=   rK   r1   )re  rD  r=   rK   r1   )r^   rC  rÅ   s     €rG   rD  zTransaction.to_jsonz  s<   ø€ å‰WŒW�_Š_ÑÔˆà”Yˆˆ6‰
Ø”{ˆˆ8‰Øœˆˆ9‰àˆ	rF   r   c                 ój   •— t          ¦   «                              ¦   «         }| j        r
| j        |d<   |S )Nr  )re  rG  r™   )r^   Útrace_contextrÅ   s     €rG   rG  zTransaction.get_trace_context„  s4   ø€ Ý™œ×1Ò1Ñ3Ô3ˆàŒ:ð 	/Ø$(¤JˆM˜&Ñ!àÐrF   rM   c                 óh   — | j         r| j         j        rt          j        | ¦  «        | _         | j         S )z¾Returns 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.)rb  ÚmutablerM   Úpopulate_from_transactionr]   s    rG   rú   zTransaction.get_baggageŒ  s6   € ð Œ}ð 	D ¤Ô 5ð 	DÝ#Ô=¸dÑCÔCˆDŒMàŒ}ÐrF   Úsampling_contextr(   c           
      ó†  — t          j        ¦   «         }|                      ¦   «         }t          |j        ¦  «        s	d| _        dS | j        �t          | j        ¦  «        | _        dS t          |j         	                    d¦  «        ¦  «        rF	  |j        d         |¦  «        }nK# t          $ r! t          j        dd¬¦  «         d| _        Y dS w xY w|d         �|d         n|j        d         }t          |d	¬
¦  «        s1t          j        d                     |¬¦  «        ¦  «         d| _        dS t          |¦  «        | _        |j        r| xj        d|j        j        z  z  c_        | j        s[t          j        d                     |t          |j         	                    d¦  «        ¦  «        rdnd¬¦  «        ¦  «         d| _        dS | j        | j        k     | _        | j        r*t          j        d                     |¬¦  «        ¦  «         dS t          j        d                     || j        ¬¦  «        ¦  «         dS )aO  
        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_samplerz1[Tracing] traces_sampler raised; unsampling traceT)Úexc_inforL   Útraces_sample_rateÚTracing)rK   zN[Tracing] Discarding {transaction_description} because of invalid sample rate.)r€  r¤   z?[Tracing] Discarding {transaction_description} because {reason}zYtraces_sampler returned 0 or False, or is using a fallback sample rate that is 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Ê   rz  r‘  rË   r1   r­   r^  ÚcallablerÛ   Ú	Exceptionr   rî   r   ry  r’  r“  rl  rë   )r^   r«  r—  r€  r^  s        rG   Ú_set_initial_sampling_decisionz*Transaction._set_initial_sampling_decision—  sÅ  € õ, Ô&Ñ(Ô(ˆà"&×">Ò">Ñ"@Ô"@Ðõ # 6¤>Ñ2Ô2ð 	Ø ˆDŒLØˆFð Œ<Ð#Ý$ T¤\Ñ2Ô2ˆDÔØˆFõ
 �F”N×&Ò&Ð'7Ñ8Ô8Ñ9Ô9ð 	ðØ>˜fœnÐ-=Ô>Ð?OÑPÔP��øÝð ð ð Ý”ØGØ!ðñ ô ð ð  %�”Ø��ðøøøð $Ð$4Ô5ÐAð !Ð!1Ô2Ð2à”^Ð$8Ô9ð õ $ K¸	ÐBÑBÔBð 	ÝŒNØ`×gÒgØ,Cð hñ ô ñô ð ð
 !ˆDŒLØˆFå  Ñ-Ô-ˆÔàŒ>ð 	DØÐÔ  6¤>Ô#CÑ CÑCÐÔð Ôð 	ÝŒLØQ×XÒXØ,Cõ $ F¤N×$6Ò$6Ð7GÑ$HÔ$HÑIÔIð>ÐsÐsà=ð Yñ ô ñ	ô 	ð 	ð !ˆDŒLØˆFð Ô(¨4Ô+;Ò;ˆŒàŒ<ð 	ÝŒLØ>×EÒEØ,Cð Fñ ô ñô ð ð ð õ ŒLð P÷  Wò  WØ,CØ $Ô 0ð Wñ ô ñô ð ð ð s   ÂB& Â&'CÃC)rY   rä   rL  )rp  rq  rr  rq  rY   r¡   rR  ©r;   r¡   r4  r5  r5   r4   rY   rŸ   rQ  rS  rT  )rY   rM   ©r«  r(   rY   N)r?   r@   rA   r�   r�   rR   ra   rB   r‡   rÆ   rD   rj  rÎ   rÖ   rU  r8   rw  rz  rÕ   r­   r  r¢  r‘   r0  rD  rG  rú   r³  Ú_get_baggager\  Ú__classcell__)rÅ   s   @rG   rä   rä     s>  ø€ € € € € ðð ð"€Ið  Ø+/Ø'+Ø'Ô.ðEð EàðEð )ðEð %ð	Eð
 ðEð 'ðEð 
ðEð Eð Eð Eð Eð Eð8
˜#ð 
ð 
ð 
ð 
ð 	H 4ð 	Hð 	Hð 	Hð 	Hðð ð ð ð ð ð	(Ø!ð	(Ø*9ð	(Ø?Nð	(à	ð	(ð 	(ð 	(ð 	(ð 	(ð 	(ð ðð ð ñ „XððàFðð Eðð 
&ð	ð ð ð ð@
¨ð 
ð 
ð 
ð 
ð /3Ø<@ð_*ð
 +/ð_*ð _*à+ð_*ð :ð_*ð
 (ð_*ð 
ð_*ð _*ð _*ð _*ð _*ð _*ðD BDðBð BØðBØ %ðBØ->ðBà	ðBð Bð Bð Bð$˜sð $Ð+;ð $Àð $ð $ð $ð $ðC¨3ð C°4ð Cð Cð Cð Cð Cð Cðð ð ð ð ð ðð ð ð ð ð ð	ð 	ð 	ð 	ðiØ 1ðià	ðið ið ið iðX €LØ*ÐÐÐÐÐrF   rä   c            	       ór  — e Zd Zdefd„Zed3d„¦   «         Zej        fdedddd fd„Z	defd	„Z
d4d„Zd4d„Zd5d„Zdeddddfd„Zdeddddfd„Zd6d„Zdeddfd„Zdeddfd„Zdefd„Zd7d„Zd8d„Zd8d„Z	 	 d9ddœ	 	 	 	 	 	 	 d:d&„Z	 d;d(eded)d*ddfd+„Zdedd,ddfd-„Zd.eddfd/„Z	 	 	 	 d<d2„Ze
ZeZ eZ!eZ"eZ#dS )=rÜ   rY   c                 ó    — d| j         j        z  S )Nz<%s>)rÅ   r?   r]   s    rG   rÆ   zNoOpSpan.__repr__  s   € Ø˜œÔ/Ñ/Ð/rF   r7   c                 ó   — d S r[   rE   r]   s    rG   r8   zNoOpSpan.containing_transaction  s   € àˆtrF   rØ   rÙ   r   c                 ó   — t          ¦   «         S r[   )rÜ   )r^   rØ   rÙ   s      rG   rá   zNoOpSpan.start_child  s   € õ ‰zŒzÐrF   c                 ó   — dS )Nr  rE   r]   s    rG   rù   zNoOpSpan.to_traceparent  s   € ØˆrrF   r  c                 ó   — d S r[   rE   r]   s    rG   r  zNoOpSpan.to_baggage  ó   € ØˆtrF   c                 ó   — d S r[   rE   r]   s    rG   rú   zNoOpSpan.get_baggage  r¾  rF   r÷   c                 ó    — t          d¦  «        S rd  )Úiterr]   s    rG   rü   zNoOpSpan.iter_headers  s   € Ý�B‰xŒxˆrF   r  r\   Nc                 ó   — d S r[   rE   r	  s      rG   r
  zNoOpSpan.set_tag   ó   € ØˆrF   c                 ó   — d S r[   rE   r	  s      rG   r  zNoOpSpan.set_data#  rÃ  rF   r  r  c                 ó   — d S r[   rE   r  s     rG   r  zNoOpSpan.update_data&  rÃ  rF   c                 ó   — d S r[   rE   r¹   s     rG   rÔ   zNoOpSpan.set_status)  rÃ  rF   r,  c                 ó   — d S r[   rE   r/  s     rG   r0  zNoOpSpan.set_http_status,  rÃ  rF   c                 ó   — dS )NTrE   r]   s    rG   r3  zNoOpSpan.is_success/  r¾  rF   c                 ó   — i S r[   rE   r]   s    rG   rD  zNoOpSpan.to_json2  ó   € Øˆ	rF   c                 ó   — i S r[   rE   r]   s    rG   rG  zNoOpSpan.get_trace_context5  rÊ  rF   c                 ó   — i S r[   rE   r]   s    rG   rJ  zNoOpSpan.get_profile_context8  rÊ  rF   r{  r;   r¡   r4  r5  r5   r4   rŸ   c                ó   — dS )z_
        The `hub` parameter is deprecated. Please use the `scope` parameter, instead.
        NrE   )r^   r;   r4  r5   s       rG   rÕ   zNoOpSpan.finish;  ó	   € ð 	ˆrF   r  r=   r  r&   c                 ó   — d S r[   rE   r  s       rG   r  zNoOpSpan.set_measurementG  ó	   € ð 	ˆrF   r   c                 ó   — d S r[   rE   r	  s      rG   r¢  zNoOpSpan.set_contextL  rÃ  rF   r�   c                 ó   — d S r[   rE   r†   s     rG   r³   zNoOpSpan.init_span_recorderO  rÃ  rF   r«  r(   c                 ó   — d S r[   rE   )r^   r«  s     rG   r³  z'NoOpSpan._set_initial_sampling_decisionR  rÐ  rF   rM  rO  rN  rP  rS  rT  rR  r´  rQ  rµ  )$r?   r@   rA   rB   rÆ   rU  r8   r	   rW  rá   rù   r  rú   rü   r
  r  r  rÔ   r‘   r0  rD   r3  rD  rG  rJ  rÕ   r­   r  r¢  r³   r³  rY  rZ  r¶  r[  r\  rE   rF   rG   rÜ   rÜ     sù  € € € € € ð0˜#ð 0ð 0ð 0ð 0ð ðð ð ñ „Xðð #/Ô"5ðð ØðØAFðà	ðð ð ð ð
 ð ð ð ð ðð ð ð ðð ð ð ðð ð ð ð˜3ð  uð °ð ð ð ð ð˜Cð ¨ð °$ð ð ð ð ðð ð ð ð ð ¨ð ð ð ð ð¨3ð °4ð ð ð ð ð˜Dð ð ð ð ðð ð ð ðð ð ð ðð ð ð ð
 /3Ø<@ð
ð
 +/ð
ð 
à+ð
ð :ð
ð
 (ð
ð 
ð
ð 
ð 
ð 
ð BDðð ØðØ %ðØ->ðà	ðð ð ð ð
˜sð Ð+;ð Àð ð ð ð ð¨ð °ð ð ð ð ðØ 1ðà	ðð ð ð ð %€OØ€KØ€LØ €MØ*ÐÐÐrF   rÜ   ©r2   r=   Ú
attributesÚtemplateÚfuncr2   rŸ   r=   rÕ  úOptional[dict[str, Any]]rÖ  r   ú*Callable[[Callable[P, R]], Callable[P, R]]c                ó   — d S r[   rE   )r×  r2   r=   rÕ  rÖ  s        rG   rˆ  rˆ  a  rÎ  rF   úCallable[P, R]c                 ó   — d S r[   rE   )r×  s    rG   rˆ  rˆ  m  rÐ  rF   úOptional[Callable[P, R]]úAUnion[Callable[P, R], Callable[[Callable[P, R]], Callable[P, R]]]c                óJ   — ddl m}  |||||¬¦  «        }| r || ¦  «        S |S )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
    r   )Úcreate_span_decoratorrÔ  )Úsentry_sdk.tracing_utilsrà  )r×  r2   r=   rÕ  rÖ  rà  Ú	decorators          rG   rˆ  rˆ  s  sX   € ðT ?Ð>Ð>Ð>Ð>Ð>à%Ð%ØØØØð	ñ ô €Ið ð Øˆy˜‰ŒÐàÐrF   )rM   rç   rf  rò   rÈ   r‘  r[   )r×  Nr2   rŸ   r=   rŸ   rÕ  rØ  rÖ  r   rY   rÙ  )r×  rÛ  rY   rÛ  )r×  rÝ  r2   rŸ   r=   rŸ   rÕ  rØ  rÖ  r   rY   rÞ  )Orµ   r§   r   r   r   Úenumr   Útypingr   r   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    Útyping_extensionsr!   r"   r#   r$   Úsentry_sdk._typesr%   r&   r'   r(   r)   Ú(sentry_sdk.profiler.transaction_profilerr*   r,   rJ   rB   rO   rð   ró   rR   rd   ÚLOW_QUALITY_TRANSACTION_SOURCESr`   rb   ÚSOURCE_FOR_STYLEr‘   r}   r   r‰   rä   rÜ   ÚDEFAULTrˆ  rá  rM   rç   rf  rò   rÈ   r‘  rE   rF   rG   ú<module>rï     s¥  ðØ €€€Ø €€€Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø Ð Ð Ð Ð Ð Ø &Ð &Ð &Ð &Ð &Ð &Ð &Ð &à Ð Ð Ð Ø NÐ NÐ NÐ NÐ NÐ NÐ NÐ NÐ NÐ NÐ NÐ NØ CÐ CÐ CÐ CÐ CÐ Cðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð kØAÐAÐAÐAÐAÐAÐAÐAÐAÐAðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð 4Ð3Ð3Ð3Ð3Ð3Ð3Ð3àˆ	�#‰Œ€AØˆ�‰Œ€Aðð ð ð ð ð ð ð ð ð ð ð ð JÐIÐIÐIÐIÐIØ@Ð@Ð@Ð@Ð@Ð@ð9að 9að 9að 9að 9a�Y eð 9añ 9aô 9að 9aðvQð Qð Qð Qð Q˜J¨eð Qñ Qô Qð Qð �YØà˜3ð	
ñô €Nð  Ð Ø)Ð ð
	ð 	ð 	ð 	ð 	˜˜Tñ 	ô 	ð 	ð Ôð#Ð ð
 "Ô+Ø&Ô0Ø%Ô/Ø0Ô6ØÔ!Ø#Ô-Ø&Ô,Ø%Ô+ØÔ"ð
ð 
Ð ð#$°Sð #$¸Sð #$ð #$ð #$ð #$ðL$ð $ð $ð $ð $ñ $ô $ð $ð.t+ð t+ð t+ð t+ð t+ñ t+ô t+ð t+ðnl+ð l+ð l+ð l+ð l+�$ñ l+ô l+ð l+ð^U+ð U+ð U+ð U+ð U+ˆtñ U+ô U+ð U+ðp ð ààð	ð #Ø $Ø15Ø#/Ô#7ð	ð 	Øð	ð ð	ð ð		ð
 /ð	ð !ð	ð 
6ð	ð 	ð 	ñ „Xð	ð ðð ð ñ „Xðð (,ðVð Ø Ø-1Ø+Ô3ðVð VØ
$ðVð 	ðVð ð	Vð
 +ðVð ðVð IðVð Vð Vð Vðvð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð rF   