o
    #ifw                  
   @   s&  d dl Z d dlZd dlmZmZmZ d dlZd dlmZmZ d dl	m
Z
mZmZmZ d dlmZ erd dlmZmZmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm Z m!Z! edZ"edZ#d dl$Zd dlm%Z%m&Z&m'Z'm(Z( G dd de ddZ)G dd de)ddZ*dZ+dZ,dZ-dZ.dZ/d Z0d!Z1d"Z2e.gZ3e1e1e1e/e.e1e/e/e/d#	Z4G d$d% d%Z5G d&d' d'Z6G d(d) d)e6Z7G d*d+ d+e6Z8ered2d,d-Z9ed.d- Z9d2d/d-Z9d d0l:m;Z;m<Z<m=Z=m>Z>m?Z? d d1l@mAZA dS )3    N)datetime	timedeltatimezone)INSTRUMENTERSPANDATA)get_current_thread_metais_valid_sample_rateloggernanosecond_time)TYPE_CHECKING)CallableMappingMutableMapping)Any)Dict)Iterator)List)Optional)overload)	ParamSpec)Tuple)Union)TypeVar)	TypedDictUnpackPR)EventMeasurementUnitSamplingContextMeasurementValuec                   @   s   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< 	 ed ed	< 	 eed
< 	 ed ed< 	 eeee	f  ed< 	 ded< dS )
SpanKwargstrace_idspan_idparent_span_idsame_process_as_parentsampledopdescriptionzsentry_sdk.HubhubstatusTransactioncontaining_transactionstart_timestampzsentry_sdk.ScopescopeN)
__name__
__module____qualname__str__annotations__boolr   r   r   float r6   r6   K/var/www/html/corbot_env/lib/python3.10/site-packages/sentry_sdk/tracing.pyr!   )   s2   
 r!   F)totalc                   @   s4   e Zd ZU eed< 	 eed< 	 eed< 	 ded< dS )TransactionKwargsnamesourceparent_sampledBaggagebaggageN)r/   r0   r1   r2   r3   r4   r6   r6   r6   r7   r9   Z   s   
 r9   r>   zsentry-tracecustomurlrouteview	componenttask)	endpointfunction_namehandler_namemethod_and_path_patternpath
route_nameroute_patternuri_templater@   c                   @   s$   e Zd ZdZdZdd Zdd ZdS )_SpanRecorderz5Limits the number of spans recorded in a transaction.maxlenspansc                 C   s   |d | _ g | _d S )N   rN   selfrO   r6   r6   r7   __init__   s   

z_SpanRecorder.__init__c                 C   s*   t | j| jkrd |_d S | j| d S N)lenrP   rO   _span_recorderappend)rS   spanr6   r6   r7   add   s   
z_SpanRecorder.addN)r/   r0   r1   __doc__	__slots__rT   rZ   r6   r6   r6   r7   rM      s
    
rM   c                   @   s  e Zd ZdZdZ												d6ddZdd Zd	d
 Zdd Zdd Z	dd Z
edd ZejfddZedd Zedd Zdd Zedd Zdd Zdd  Zd!d" Zd#d$ Zd%d& Zd7d(d)Zd*d+ Zd,d- Zd.d/ Zd8d0d1Zd2d3 Zd4d5 Z dS )9Spana  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.
    :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.
    )r"   r#   r$   r%   r&   r'   r(   _measurementsr-   _start_timestamp_monotonic_nsr*   	timestamp_tags_datarW   r)   _context_manager_state_containing_transaction_local_aggregatorr.   NTc                 C   s   |pt  j| _|pt  jdd  | _|| _|| _|| _|| _|| _	|	| _
|| _|| _i | _i | _i | _|
| _|d u rCttj}nt|trOt|tj}|| _zt | _W n	 tya   Y nw d | _d | _d | _t \}}|  || d S )N   )!uuiduuid4hexr"   r#   r$   r%   r&   r'   r(   r*   r)   r.   r^   ra   rb   rd   r   nowr   utc
isinstancer5   fromtimestampr-   r
   r_   AttributeErrorr`   rW   re   r   
set_thread)rS   r"   r#   r$   r%   r&   r'   r(   r)   r*   r,   r-   r.   	thread_idthread_namer6   r6   r7   rT      s:   

zSpan.__init__c                 C   s   | j d u rt|| _ d S d S rU   )rW   rM   rR   r6   r6   r7   init_span_recorder  s   
zSpan.init_span_recorderc                 C   s   | j }|d u rt  }| _ |S rU   )re   LocalAggregatorrS   rvr6   r6   r7   _get_local_aggregator  s   zSpan._get_local_aggregatorc                 C   s&   d| j j| j| j| j| j| j| jf S )NzS<%s(op=%r, description:%r, trace_id=%r, span_id=%r, parent_span_id=%r, sampled=%r)>)	__class__r/   r'   r(   r"   r#   r$   r&   rS   r6   r6   r7   __repr__  s   zSpan.__repr__c                 C   s*   | j ptj }|j}| |_||f| _| S rU   )r.   
sentry_sdkScopeget_current_scoperY   rc   )rS   r.   old_spanr6   r6   r7   	__enter__#  s
   
zSpan.__enter__c                 C   s4   |d ur	|  d | j\}}| `| | ||_d S )Ninternal_error)
set_statusrc   finishrY   )rS   tyvaluetbr.   r}   r6   r6   r7   __exit__+  s   



zSpan.__exit__c                 C   s   | j S )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".)rd   rx   r6   r6   r7   r,   5  s   
zSpan.containing_transactionc                 K   sh   t j jd }||krt S |d| j td| j| j	| j
d|}| j
o*| j
j}|r2|| |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.
        instrumenterr&   )r"   r$   r,   Nr6   )rz   r{   
get_clientoptionsNoOpSpan
setdefaultr&   r]   r"   r#   r,   rW   rZ   )rS   r   kwargsconfiguration_instrumenterchildspan_recorderr6   r6   r7   start_childA  s$   
	
zSpan.start_childc                 K   s(   | t u r	td tjt|fi |S )a(  
        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.
        zXDeprecated: use Transaction.continue_from_environ instead of Span.continue_from_environ.)r]   r	   warningr+   continue_from_headersEnvironHeaders)clsenvironr   r6   r6   r7   continue_from_environb  s
   zSpan.continue_from_environc                 K   sp   | t u r	td t|t}|t|i t|t	}|dur,|| |
  tdi |}d|_|S )z
        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.
        zXDeprecated: use Transaction.continue_from_headers instead of Span.continue_from_headers.NFr6   )r]   r	   r   r=   from_incoming_headergetBAGGAGE_HEADER_NAMEupdateextract_sentrytrace_dataSENTRY_TRACE_HEADER_NAMEfreezer+   r%   )r   headersr   r>   sentrytrace_kwargstransactionr6   r6   r7   r   |  s   
zSpan.continue_from_headersc                 c   s>    | 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)r,   r   to_traceparentget_baggage	serializer   )rS   r>   r6   r6   r7   iter_headers  s   zSpan.iter_headersc                 K   s(   t d |s	dS | jt|ifi |S )a  
        DEPRECATED: Use :py:meth:`sentry_sdk.tracing.Span.continue_from_headers`.

        Create a ``Transaction`` with the given params, then add in data pulled from
        the given ``sentry-trace`` header value before returning the ``Transaction``.
        zwDeprecated: Use Transaction.continue_from_headers(headers, **kwargs) instead of from_traceparent(traceparent, **kwargs)N)r	   r   r   r   )r   traceparentr   r6   r6   r7   from_traceparent  s   zSpan.from_traceparentc                 C   sN   | j du rd}n
| j du rd}nd }d| j| jf }|d ur%|d|f 7 }|S )NT1F0z%s-%sz-%s)r&   r"   r#   )rS   r&   r   r6   r6   r7   r     s   

zSpan.to_traceparentc                 C   s   | j r| j  S dS )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   rx   r6   r6   r7   
to_baggage  s   
zSpan.to_baggagec                 C      || j |< d S rU   )ra   rS   keyr   r6   r6   r7   set_tag     zSpan.set_tagc                 C   r   rU   )rb   r   r6   r6   r7   set_data  r   zSpan.set_datac                 C   s
   || _ d S rU   r*   rS   r   r6   r6   r7   r        
zSpan.set_status c                 C      ||d| j |< d S N)r   unitr^   rS   r:   r   r   r6   r6   r7   set_measurement     zSpan.set_measurementc                 C   s<   |d ur|  tjt| |d ur|  tj| d S d S d S rU   )r   r   	THREAD_IDr2   THREAD_NAME)rS   rp   rq   r6   r6   r7   ro     s   zSpan.set_threadc                 C   sT  |  dt| | tj| |dk r| d d S d|  kr$dk ron nI|dkr1| d d S |dkr<| d d S |d	krG| d
 d S |dkrR| d d S |dkr]| d d S |dkrh| d d S | d d S d|  krydk rn n(|dkr| d d S |dkr| d d S |dkr| d d S | d d S | d d S )Nzhttp.status_codei  oki  i  permission_deniedi  	not_foundi  resource_exhaustedi  failed_preconditioni  unauthenticatedi  already_existsinvalid_argumentiX  i  deadline_exceededi  unimplementedi  unavailabler   unknown_error)r   r2   r   r   HTTP_STATUS_CODEr   rS   http_statusr6   r6   r7   set_http_status  s:   zSpan.set_http_statusc                 C   s
   | j dkS )Nr   r   rx   r6   r6   r7   
is_success(  r   zSpan.is_successc                 C   s   | j durdS z%|rt|trt|tj}|| _ nt | j }| j	t
|d d | _ W n ty<   ttj| _ Y nw |pCtj }t||  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  )microseconds)r`   rl   r5   r   rm   r   rk   r
   r_   r-   r   rn   rj   rz   r{   r|   "maybe_create_breadcrumbs_from_span)rS   r.   end_timestampelapsedr6   r6   r7   r   ,  s$   



zSpan.finishc              	   C   s   | j | j| j| j| j| j| j| jd}| jr| j| j	d< | j
dur,| j
 }|r,||d< t| jdkr8| j|d< | j	}|rA||d< | j}|rJ||d< |S )	z5Returns a JSON-compatible representation of the span.)r"   r#   r$   r%   r'   r(   r-   r`   r*   N_metrics_summaryr   measurementstagsdata)r"   r#   r$   r%   r'   r(   r-   r`   r*   ra   re   to_jsonrV   r^   rb   )rS   ru   metrics_summaryr   r   r6   r6   r7   r   R  s0   


zSpan.to_jsonc                 C   sF   | j | j| j| j| jd}| jr| j|d< | jr!| j  |d< |S )N)r"   r#   r$   r'   r(   r*   dynamic_sampling_context)	r"   r#   r$   r'   r(   r*   r,   r   r   rt   r6   r6   r7   get_trace_contextv  s   
zSpan.get_trace_context)NNNTNNNNNNNNr   NN)!r/   r0   r1   r[   r\   rT   rr   rv   ry   r~   r   propertyr,   r   SENTRYr   classmethodr   r   r   r   r   r   r   r   r   r   ro   r   r   r   r   r   r6   r6   r6   r7   r]      sV    
5

!

)
	
	$
&$r]   c                       s   e Zd ZdZdZdddef fdd	Zdd Zd	d
 Z fddZ	 fddZ
edd Zd fdd	Zd ddZdd Z fddZ fddZdd Zdd Z  ZS )!r+   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:   r;   r<   sample_rater^   	_contexts_profile_baggager   Nc                    sF   t  jdi | || _|| _d | _|| _i | _i | _d | _|| _	d S Nr6   )
superrT   r:   r;   r   r<   r^   r   r   r   )rS   r:   r<   r>   r;   r   rw   r6   r7   rT     s   

zTransaction.__init__c              	   C   s*   d| j j| j| j| j| j| j| j| jf S )NzW<%s(name=%r, op=%r, trace_id=%r, span_id=%r, parent_span_id=%r, sampled=%r, source=%r)>)	rw   r/   r:   r'   r"   r#   r$   r&   r;   rx   r6   r6   r7   ry     s   zTransaction.__repr__c                 C   s   | j dup	| jdu S )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)rW   r&   rx   r6   r6   r7   _possibly_started  s   
zTransaction._possibly_startedc                    s4   |   s	td t   | jd ur| j  | S )NzTransaction 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	   r   r   r~   r   rx   r   r6   r7   r~     s   


zTransaction.__enter__c                    s.   | j d ur| j ||| t ||| d S rU   )r   r   r   )rS   r   r   r   r   r6   r7   r     s   
zTransaction.__exit__c                 C   s   | S )znThe root element of the span tree.
        In the case of a transaction it is the transaction itself.
        r6   rx   r6   r6   r7   r,     s   
z"Transaction.containing_transactionc           	   	      s  | j durdS |p| jptjj}tj }| sdS | jdu rP| j	du r+t
d nt
d |jrNt|jrN|jrD|jjdkrDd}nd}|jj|dd	 dS | js[t
d
 d| _t || | j	sq| j	du rot
d dS dd | jjD }d| _i }|| j |d|  i d| jd| ji|| j| j | j|d}| jdur| j r| j|d< d| _| j|d< | j dur| j ! }|r||d< |"|S )a  Finishes the transaction and sends it to Sentry.
        All finished spans in the transaction will also be sent to Sentry.

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

        :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_categoryzCTransaction has no name, falling back to `<unlabeled transaction>`.z<unlabeled transaction>z1Discarding transaction without sampling decision.c                 S   s   g | ]}|j d ur| qS rU   )r`   r   ).0rY   r6   r6   r7   
<listcomp>:  s
    
z&Transaction.finish.<locals>.<listcomp>tracer;   )typer   transaction_infocontextsr   r`   r-   rP   profiler   r   )#r`   r)   rz   Hubcurrentr{   r   	is_activerW   r&   r	   debug	transporthas_tracing_enabledr   monitordownsample_factorrecord_lost_eventr:   r   r   r   rP   r   r   r   r;   ra   r-   r   validr^   re   r   capture_event)	rS   r)   r   clientreasonfinished_spansr   eventr   r   r6   r7   r     sj   











zTransaction.finishc                 C   r   r   r   r   r6   r6   r7   r   d  r   zTransaction.set_measurementc                 C   s   || 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   r6   r6   r7   set_contexth  s   	zTransaction.set_contextc                    s    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.responsestatus_codeN)r   r   r   r   r   r6   r7   r   s  s   zTransaction.set_http_statusc                    s,   t   }| j|d< | j|d< | j|d< |S )z<Returns a JSON-compatible representation of the transaction.r:   r;   r&   )r   r   r:   r;   r&   rt   r   r6   r7   r   {  s
   



zTransaction.to_jsonc                 C   s    | j r| j jrt| | _ | j S )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   mutabler=   populate_from_transactionrx   r6   r6   r7   r     s   zTransaction.get_baggagec                 C   sd  t j }dj| jrd| j d nd| jd}t|js!d| _dS | jdur.t	| j| _
dS t|jdr=|jd |n|d	 durG|d	 n|jd
 }t|dds`tdj|d d| _dS t	|| _
|jrs|  j
d|jj   _
| j
stdj|t|jdrdndd d| _dS t | j
k | _| jrtdj|d dS tdj|| j
d 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.
        z{op}transaction <{name}><z> r   )r'   r:   FNtraces_samplerr<   traces_sample_rateTracing)r;   zN[Tracing] Discarding {transaction_description} because of invalid sample rate.)transaction_description   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   )rz   r{   r   formatr'   r:   r   r   r&   r5   r   callabler   r   r	   r   r   r   r   random)rS   sampling_contextr   r  r   r6   r6   r7   _set_initial_sampling_decision  sf   




z*Transaction._set_initial_sampling_decisionr   r   )r/   r0   r1   r[   r\   TRANSACTION_SOURCE_CUSTOMrT   ry   r   r~   r   r   r,   r   r   r   r   r   r   r  __classcell__r6   r6   r   r7   r+     s*    

hr+   c                   @   s   e Zd Zdd Zedd ZejfddZdd Z	d	d
 Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zd)ddZd*d!d"Zd#d$ Zd%d& Zd'd( ZdS )+r   c                 C   s   d| j j S )Nz<%s>)rw   r/   rx   r6   r6   r7   ry     s   zNoOpSpan.__repr__c                 C      d S rU   r6   rx   r6   r6   r7   r,        zNoOpSpan.containing_transactionc                 K   s   t  S rU   )r   )rS   r   r   r6   r6   r7   r     s   zNoOpSpan.start_childc                 C      dS )Nr   r6   rx   r6   r6   r7   r   
     zNoOpSpan.to_traceparentc                 C   r  rU   r6   rx   r6   r6   r7   r     r  zNoOpSpan.to_baggagec                 C   r  rU   r6   rx   r6   r6   r7   r     r  zNoOpSpan.get_baggagec                 C   s   t dS r   )iterrx   r6   r6   r7   r     s   zNoOpSpan.iter_headersc                 C   r  rU   r6   r   r6   r6   r7   r     r  zNoOpSpan.set_tagc                 C   r  rU   r6   r   r6   r6   r7   r     r  zNoOpSpan.set_datac                 C   r  rU   r6   r   r6   r6   r7   r   "  r  zNoOpSpan.set_statusc                 C   r  rU   r6   r   r6   r6   r7   r   &  r  zNoOpSpan.set_http_statusc                 C   r  )NTr6   rx   r6   r6   r7   r   *  r  zNoOpSpan.is_successc                 C      i S rU   r6   rx   r6   r6   r7   r   .  r  zNoOpSpan.to_jsonc                 C   r  rU   r6   rx   r6   r6   r7   r   2  r  zNoOpSpan.get_trace_contextNc                 C   r  rU   r6   )rS   r)   r   r6   r6   r7   r   6  r  zNoOpSpan.finishr   c                 C   r  rU   r6   r   r6   r6   r7   r   :  r  zNoOpSpan.set_measurementc                 C   r  rU   r6   r   r6   r6   r7   r   >  r  zNoOpSpan.set_contextc                 C   r  rU   r6   rR   r6   r6   r7   rr   B  r  zNoOpSpan.init_span_recorderc                 C   r  rU   r6   )rS   r  r6   r6   r7   r  F  r  z'NoOpSpan._set_initial_sampling_decisionr   r   )r/   r0   r1   ry   r   r,   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rr   r  r6   r6   r6   r7   r     s*    


r   c                 C   r  rU   r6   funcr6   r6   r7   r   M  r  r   c                 C   r  rU   r6   r  r6   r6   r7   r   R  r  c                 C   s   ddl m} | r|| S |S )av  
    Decorator to start a child span under the existing current transaction.
    If there is no current transaction, then nothing will be traced.

    .. code-block::
        :caption: Usage

        import sentry_sdk

        @sentry_sdk.trace
        def my_function():
            ...

        @sentry_sdk.trace
        async def my_async_function():
            ...
    r   )start_child_span_decorator)sentry_sdk.tracing_utilsr  )r  r  r6   r6   r7   r   X  s   )r=   r   r   r   r   )rs   rU   )Brg   r  r   r   r   rz   sentry_sdk.constsr   r   sentry_sdk.utilsr   r   r	   r
   sentry_sdk._typesr   collections.abcr   r   r   typingr   r   r   r   r   r   r   r   r   r   typing_extensionsr   r   r   r   sentry_sdk.profilerr   r   r   r    r!   r9   r   r   r  TRANSACTION_SOURCE_URLTRANSACTION_SOURCE_ROUTETRANSACTION_SOURCE_VIEWTRANSACTION_SOURCE_COMPONENTTRANSACTION_SOURCE_TASKLOW_QUALITY_TRANSACTION_SOURCESSOURCE_FOR_STYLErM   r]   r+   r   r   r  r=   r   r   r   r   sentry_sdk.metricsrs   r6   r6   r6   r7   <module>   s~    1   k  tO

