
    YfD              
       `   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e d      Z) G d de)d      Z*dZ+dZ,dZ-dZ.dZ/d Z0d!Z1d"Z2e.gZ3e1e1e1e/e.e1e/e/e/d#	Z4 G d$ d%      Z5 G d& d'      Z6 G d( d)e6      Z7 G d* d+e6      Z8ered1d,       Z9ed-        Z9d1d.Z9d d/l:m;Z;m<Z<m=Z=m>Z>m?Z? d d0l@mAZA y)2    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                       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<   y)
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     R/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/sentry_sdk/tracing.pyr#   r#   )   s    	
 T< $$J	
 	
 Q&''sr ( 778!%%"899	
 "!Xr9   r#   F)totalc                   <    e Zd ZU eed<   	 eed<   	 eed<   	 ded<   y)TransactionKwargsnamesourceparent_sampledBaggagebaggageN)r1   r2   r3   r4   r5   r6   r8   r9   r:   r=   r=   Z   s(    	K	 Pr9   r=   rB   zsentry-tracecustomurlrouteview	componenttask)	endpointfunction_namehandler_namemethod_and_path_patternpath
route_nameroute_patternuri_templaterD   c                        e Zd ZdZdZd Zd Zy)_SpanRecorderz5Limits the number of spans recorded in a transaction.maxlenspansc                 &    |dz
  | _         g | _        y )N   rS   selfrT   s     r:   __init__z_SpanRecorder.__init__   s     qj
r9   c                     t        | j                        | j                  kD  rd |_        y | j                  j	                  |       y N)lenrU   rT   _span_recorderappend)rY   spans     r:   addz_SpanRecorder.add   s0    tzz?T[[("&DJJd#r9   N)r1   r2   r3   __doc__	__slots__rZ   ra   r8   r9   r:   rR   rR      s    ?#I$r9   rR   c                      e Zd ZdZdZ	 	 	 	 	 	 	 	 	 	 	 	 ddZd Zd Zd Zd Z	d	 Z
ed
        Zej                  fdZed        Zed        Zd Zed        Zd Zd Zd Zd Zd ZddZd Zd Zd ZddZd Zd Z y)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_datar^   r+   _context_manager_state_containing_transaction_local_aggregatorr0   Nc                    |xs t        j                         j                  | _        |xs! t        j                         j                  dd  | _        || _        || _        || _        || _        || _	        |	| _
        || _        || _        i | _        i | _        i | _        |
| _        |$t#        j$                  t&        j(                        }n4t+        |t,              r$t#        j.                  |t&        j(                        }|| _        	 t3               | _        d | _        d | _        d | _        t?               \  }}| jA                  ||       y # t6        $ r Y @w xY w)N   )!uuiduuid4hexr$   r%   r&   r'   r(   r)   r*   r,   r+   r0   rf   ri   rj   rl   r   nowr   utc
isinstancer7   fromtimestampr/   r   rg   AttributeErrorrh   r^   rm   r   
set_thread)rY   r$   r%   r&   r'   r(   r)   r*   r+   r,   r.   r/   r0   	thread_idthread_names                  r:   rZ   zSpan.__init__   s/     !4DJJL$4$47$**,"2"223"7,&<#&


'=$"&ll8<<8O/&44_hllSO.	 2A1BD.
 "!%!8!:	;	;/  		s   E 	EEc                 >    | j                   t        |      | _         y y r\   )r^   rR   rX   s     r:   init_span_recorderzSpan.init_span_recorder  s     &"/"7D 'r9   c                 D    | j                   }|t               x}| _         |S r\   )rm   LocalAggregatorrY   rvs     r:   _get_local_aggregatorzSpan._get_local_aggregator  s'    ##:*9*;;B'	r9   c                     d| j                   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=)>)	__class__r1   r)   r*   r$   r%   r&   r(   rY   s    r:   __repr__zSpan.__repr__  sI    
 ''  ##		
r9   c                     | j                   xs t        j                  j                         }|j                  }| |_        ||f| _        | S r\   )r0   
sentry_sdkScopeget_current_scoper`   rk   )rY   r0   old_spans      r:   	__enter__zSpan.__enter__#  sA    

Bj..@@B::
',h&7#r9   c                 |    || j                  d       | j                  \  }}| `| j                  |       ||_        y )Ninternal_error)
set_statusrk   finishr`   )rY   tyvaluetbr0   r   s         r:   __exit__zSpan.__exit__+  s=    OO,-55x'E
r9   c                     | 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".)rl   r   s    r:   r.   zSpan.containing_transaction5  s     +++r9   c                 z   t         j                  j                         j                  d   }||k7  r
t	               S |j                  d| j                         t        d| j                  | j                  | j                  d|}| j                  xr | j                  j                  }|r|j                  |       |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.   r8   )r   r   
get_clientoptionsNoOpSpan
setdefaultr(   re   r$   r%   r.   r^   ra   )rY   r   kwargsconfiguration_instrumenterchildspan_recorders         r:   start_childzSpan.start_childA  s     &0%5%5%@%@%B%J%J&
" 55:)T\\2 
]]<<#'#>#>
 	
 ''VD,G,G,V,V 	 e$r9   c                 z    | t         u rt        j                  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.)re   r
   warningr-   continue_from_headersEnvironHeaders)clsenvironr   s      r:   continue_from_environzSpan.continue_from_environb  s9    & $;NN9 001HSFSSr9   c                 d   | t         u rt        j                  d       t        j                  |j                  t                    }|j                  t        |i       t        |j                  t                    }|!|j                  |       |j                          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.Fr8   )re   r
   r   rA   from_incoming_headergetBAGGAGE_HEADER_NAMEupdateextract_sentrytrace_dataSENTRY_TRACE_HEADER_NAMEfreezer-   r'   )r   headersr   rB   sentrytrace_kwargstransactions         r:   r   zSpan.continue_from_headers|  s     $;NN9 ..w{{;N/OP*G455KK01
 )MM,-
 NN!+F+-2*r9   c              #      K   | j                   syt        | j                         f | j                   j                         j	                         }|rt
        |f yyw)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   )rY   rB   s     r:   iter_headerszSpan.iter_headers  sZ      **
 &(;(;(===--99;EEG%w.. s   AAc                 d    t        j                  d       |sy | 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   s      r:   from_traceparentzSpan.from_traceparent  sC     	A	

 (s((%{3
7=
 	
r9   c                     | j                   du rd}n| j                   du rd}nd }| j                  d| j                  }||d|z  }|S )NT1F0-)r(   r$   r%   )rY   r(   r   s      r:   r   zSpan.to_traceparent  sT    <<4G\\U"GG!%=G--Kr9   c                 P    | j                   r| j                   j                         S y)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   r   s    r:   
to_baggagezSpan.to_baggage  s%    
 &&..::<<r9   c                 "    || j                   |<   y r\   )ri   rY   keyr   s      r:   set_tagzSpan.set_tag      

3r9   c                 "    || j                   |<   y r\   )rj   r   s      r:   set_datazSpan.set_data  r   r9   c                     || _         y r\   r,   rY   r   s     r:   r   zSpan.set_status  s	    r9   c                 (    ||d| j                   |<   y N)r   unitrf   rY   r>   r   r   s       r:   set_measurementzSpan.set_measurement      -2D#A4 r9   c                     |M| j                  t        j                  t        |             |!| j                  t        j                  |       y y y r\   )r   r   	THREAD_IDr4   THREAD_NAME)rY   ry   rz   s      r:   rx   zSpan.set_thread  sF      MM(,,c)n=&h22K@ ' !r9   c                    | j                  dt        |             | j                  t        j                  |       |dk  r| j                  d       y d|cxk  rdk  rn n|dk(  r| j                  d       y |dk(  r| j                  d       y |d	k(  r| j                  d
       y |dk(  r| j                  d       y |dk(  r| j                  d       y |dk(  r| j                  d       y | j                  d       y d|cxk  rdk  rZn nW|dk(  r| j                  d       y |dk(  r| j                  d       y |dk(  r| j                  d       y | j                  d       y | j                  d       y )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   r4   r   r   HTTP_STATUS_CODEr   rY   http_statuss     r:   set_http_statuszSpan.set_http_status  s<   K 0	
 	h//=OOD!K%#%c! 34#,# 45# 56# 12# 01 23K%#%c! 34#0#. 01OOO,r9   c                      | j                   dk(  S )Nr   r   r   s    r:   
is_successzSpan.is_success(  s    {{d""r9   c                    | j                   y	 |r<t        |t              r$t        j                  |t
        j                        }|| _         n8t               | j                  z
  }| j                  t        |dz        z   | _         |xs t        j                  j                         }t!        ||        y# t        $ r+ t        j                  t
        j                        | _         Y bw xY w)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)rh   ru   r7   r   rv   r   rt   r   rg   r/   r   rw   rs   r   r   r   "maybe_create_breadcrumbs_from_span)rY   r0   end_timestampelapseds       r:   r   zSpan.finish,  s      >>%	8mU3$,$:$:=(,,$WM!.)+d.P.PP!%!5!5	!(49 " =));;=*5$7  	8%\\(,,7DN	8s   A6B4 41C('C(c           	         | j                   | j                  | j                  | j                  | j                  | j
                  | j                  | j                  d}| j                  r| j                  | j                  d<   | j                  !| j                  j                         }|r||d<   t        | j                        dkD  r| j                  |d<   | j                  }|r||d<   | j                  }|r||d<   |S )z5Returns a JSON-compatible representation of the span.)r$   r%   r&   r'   r)   r*   r/   rh   r,   _metrics_summaryr   measurementstagsdata)r$   r%   r&   r'   r)   r*   r/   rh   r,   ri   rm   to_jsonr]   rf   rj   )rY   r   metrics_summaryr   r   s        r:   r   zSpan.to_jsonR  s    
 ||"11&*&A&A''++#33	
 ;;#';;DJJx !!-"44<<>O)8%&t!!"Q&!%!3!3B~zzBvJzzBvJ	r9   c                    | j                   | j                  | j                  | j                  | j                  d}| j
                  r| j
                  |d<   | j                  r+| j                  j                         j                         |d<   |S )N)r$   r%   r&   r)   r*   r,   dynamic_sampling_context)	r$   r%   r&   r)   r*   r,   r.   r   r   r   s     r:   get_trace_contextzSpan.get_trace_contextv  s~     ||"11''++
 ;;;;BxL&&++779RRT )* 	r9   )NNNTNNNNNNNN NN)!r1   r2   r3   rb   rc   rZ   r|   r   r   r   r   propertyr.   r   SENTRYr   classmethodr   r   r   r   r   r   r   r   r   r   rx   r   r   r   r   r   r8   r9   r:   re   re      s    2I2 ##10j8

 	, 	, (4':': B T T2 ' 'R/( 
 
0  BA"-H#$L"Hr9   re   c                        e Zd ZdZdZdddef fd	Zd Z fdZ fdZ	e
d	        Zd fd
	ZddZd Z fdZ fdZd Zd Z x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_raterf   	_contexts_profile_baggager   Nc                     t        |   di | || _        || _        d | _        || _        i | _        i | _        d | _        || _	        y Nr8   )
superrZ   r>   r?   r  r@   rf   r  r  r  )rY   r>   r@   rB   r?   r   r   s         r:   rZ   zTransaction.__init__  sP     	"6"	,r9   c                     d| j                   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   r1   r>   r)   r$   r%   r&   r(   r?   r   s    r:   r   zTransaction.__repr__  sN    
 ''		##
	
r9   c                 p    t         |           | j                  | j                  j                          | S r\   )r	  r   r  )rY   r   s    r:   r   zTransaction.__enter__  s-    ==$MM##%r9   c                 z    | j                   | j                   j                  |||       t        |   |||       y r\   )r  r   r	  )rY   r   r   r   r   s       r:   r   zTransaction.__exit__  s4    ==$MM""2ub1UB'r9   c                     | S )znThe root element of the span tree.
        In the case of a transaction it is the transaction itself.
        r8   r   s    r:   r.   z"Transaction.containing_transaction  s	     r9   c           	         | j                   y|xs( | j                  xs t        j                  j                  }t        j
                  j                         }|j                         sy| j                  | j                  du rt        j                  d       nt        j                  d       |j                  r\t        |j                        rG|j                  r|j                  j                   dkD  rd}nd}|j                  j#                  |d	       y| j$                  st        j&                  d
       d| _        t(        
| U  ||       | j                  s"| j                  t        j&                  d       y| j                  j,                  D cg c]  }|j                   |j/                           }}d| _        i }|j1                  | j2                         |j1                  d| j5                         i       d| j$                  d| j6                  i|| j8                  | j                   | j:                  |d}| j<                  0| j<                  j?                         r| j<                  |d<   d| _        | j@                  |d<   | jB                  !| jB                  j/                         }	|	r|	|d<   |jE                  |      S c c}w )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.tracer?   )typer   transaction_infocontextsr   rh   r/   rU   profiler   r   )#rh   r+   r   Hubcurrentr   r   	is_activer^   r(   r
   debug	transporthas_tracing_enabledr   monitordownsample_factorrecord_lost_eventr>   r   r	  r   rU   r   r   r  r   r?   ri   r/   r  validrf   rm   capture_event)rY   r+   r   clientreasonr`   finished_spansr  eventr   r   s             r:   r   zTransaction.finish  sb    >>%7TXX7!7!7!!,,.!&||u$MNi $7$G>>fnn&F&F&J+F*F  2262WyyNNU 2DIsM*|| ||#RS ++11
~~) LLN
 
 #'$"8"8":;< "99!)4;; 7 JJ#33#	
 ==$)<)<)>#}}E) DM $ 2 2n !!-"44<<>O,;()  ''Q
s   #Kc                 (    ||d| j                   |<   y r   r   r   s       r:   r   zTransaction.set_measurementQ  r   r9   c                 "    || j                   |<   y)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      r:   set_contextzTransaction.set_contextU  s     $sr9   c                 L    t         |   |       | j                  dd|i       y)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'  )rY   r   r   s     r:   r   zTransaction.set_http_status`  s'    
 	,m[%ABr9   c                 ~    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(   )rY   r   r   s     r:   r   zTransaction.to_jsonh  s=     W_YY6
{{89	r9   c                     | j                   r| j                   j                  rt        j                  |       | _         | 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  mutablerA   populate_from_transactionr   s    r:   r   zTransaction.get_baggages  s3     }} 5 5#==dCDM}}r9   c           
         t         j                  j                         }dj                  | j                  rd| j                  z   dz   nd| j
                        }t        |j                        sd| _        y| j                  t        | j                        | _
        yt        |j                  j                  d            r |j                  d   |      n|d	   |d	   n|j                  d
   }t        |d      s-t        j                  dj                  |             d| _        yt        |      | _
        |j                   r,| xj                  d|j                   j"                  z  z  c_
        | j                  sTt        j$                  dj                  |t        |j                  j                  d            rdnd             d| _        yt'        j&                         | j                  k  | _        | j                  r&t        j$                  dj                  |             yt        j$                  dj                  || j                               y)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}>r   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)r3  r"  z,[Tracing] Starting {transaction_description}z}[Tracing] Discarding {transaction_description} because it's not included in the random sample (sampling rate = {sample_rate}))r3  r  )r   r   r   formatr)   r>   r  r   r(   r7   r  callabler   r	   r
   r   r  r  r  random)rY   sampling_contextr!  r3  r  s        r:   _set_initial_sampling_decisionz*Transaction._set_initial_sampling_decision  s'   * !!,,."<"C"C(,dgg$Rtyy #D #

 #6>>2 DL <<#$T\\2D **+;<= -FNN+,-=>
 $$45A !!12^^$89 	 $K	BNN`gg,C h 
 !DL ->>6>>#C#C CC LLQXX,C $FNN$6$67G$HI == Y 	 !DL
 }})9)99<<LL>EE,C F  LL P  W  W,C $ 0 0 W r9   r   r   )r1   r2   r3   rb   rc   TRANSACTION_SOURCE_CUSTOMrZ   r   r   r   r   r.   r   r   r'  r   r   r   r9  __classcell__)r   s   @r:   r-   r-     sm    "
I ( *
 ( 	 	f(PB	$C	fr9   r-   c                       e Zd Zd Zed        Zej                  fdZd Z	d Z
d Zd Zd Zd	 Zd
 Zd Zd Zd Zd ZddZddZd Zd Zd Zy)r   c                 4    d| j                   j                  z  S )Nz<%s>)r   r1   r   s    r:   r   zNoOpSpan.__repr__  s    ////r9   c                      y r\   r8   r   s    r:   r.   zNoOpSpan.containing_transaction  s     r9   c                     t               S r\   )r   )rY   r   r   s      r:   r   zNoOpSpan.start_child  s
    zr9   c                      y)Nr   r8   r   s    r:   r   zNoOpSpan.to_traceparent  s    r9   c                      y r\   r8   r   s    r:   r   zNoOpSpan.to_baggage      r9   c                      y r\   r8   r   s    r:   r   zNoOpSpan.get_baggage  rB  r9   c                     t        d      S r  )iterr   s    r:   r   zNoOpSpan.iter_headers  s    Bxr9   c                      y r\   r8   r   s      r:   r   zNoOpSpan.set_tag      r9   c                      y r\   r8   r   s      r:   r   zNoOpSpan.set_data  rG  r9   c                      y r\   r8   r   s     r:   r   zNoOpSpan.set_status  rG  r9   c                      y r\   r8   r   s     r:   r   zNoOpSpan.set_http_status  rG  r9   c                      y)NTr8   r   s    r:   r   zNoOpSpan.is_success  rB  r9   c                     i S r\   r8   r   s    r:   r   zNoOpSpan.to_json      	r9   c                     i S r\   r8   r   s    r:   r   zNoOpSpan.get_trace_context  rM  r9   Nc                      y r\   r8   )rY   r+   r   s      r:   r   zNoOpSpan.finish#  rG  r9   c                      y r\   r8   r   s       r:   r   zNoOpSpan.set_measurement'  rG  r9   c                      y r\   r8   r   s      r:   r'  zNoOpSpan.set_context+  rG  r9   c                      y r\   r8   rX   s     r:   r|   zNoOpSpan.init_span_recorder/  rG  r9   c                      y r\   r8   )rY   r8  s     r:   r9  z'NoOpSpan._set_initial_sampling_decision3  rG  r9   r   r   )r1   r2   r3   r   r   r.   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r'  r|   r9  r8   r9   r:   r   r     s{    0   (4':': r9   r   c                      y r\   r8   funcs    r:   r  r  :       	r9   c                      y r\   r8   rU  s    r:   r  r  ?  rW  r9   c                 &    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_utilsrZ  )rV  rZ  s     r:   r  r  E  s    & D )$//))r9   )rA   r   r   r  r   )r~   r\   )Brp   r7  r   r   r   r   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#   r=   r   r   r:  TRANSACTION_SOURCE_URLTRANSACTION_SOURCE_ROUTETRANSACTION_SOURCE_VIEWTRANSACTION_SOURCE_COMPONENTTRANSACTION_SOURCE_TASKLOW_QUALITY_TRANSACTION_SOURCESSOURCE_FOR_STYLErR   re   r-   r   r  r[  rA   r   r   r  r   sentry_sdk.metricsr~   r8   r9   r:   <module>rk     sj     2 2  4  ,AA 3#AA /YYe /YbQJe Q$   ) 
 %  "   *    # 
 -107".-,#
 $ $.e eP\$ \~
Lt L^    
*>  /r9   