o
    h                     @   sd  d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm	Z	 d dl
mZ d dlmZmZ d dlZd dlZd dlmZ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 m!Z!m"Z"m#Z# d dl$m%Z% e%rd 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, e-dZ.dZ/G dd deZ0dd Z1e j2		dKddZ3dd Z4dd Z5dd Z6dd  Z7d!d" Z8d#d$ Z9G d%d& d&Z:G d'd( d(Z;d)d* Z<d+d, Z=dddej>fd-d.Z?dLd/d0Z@dLd1d2ZAd3d4d5d6ZBd7d8 ZCd9d: ZDdLd;d<ZEd=d> ZFd?d@ ZGdAdB ZHdCdD ZIdEdF ZJdGdH ZKd dIlLmMZMmNZNmOZO e%r0d dJlLmPZP dS dS )M    N)Mapping)	timedelta)Random)quoteunquote)OPSPANDATA
SPANSTATUSSPANTEMPLATE)capture_internal_exceptionsfilename_for_moduleDsnloggermatch_regex_listqualname_from_function	safe_repr	to_stringtry_convertis_sentry_url_is_external_source_is_in_project_root_module_in_list)TYPE_CHECKING)Any)Dict)	Generator)Optional)Union)	FrameTypez5^[ 	]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ 	]*$z(([a-zA-Z0-9+/]{4})*([a-zA-Z0-9+/]{2,3})?c                   @   s0   e Zd Z	dddZdd Zdd Zdd	 Zd
S )EnvironHeadersHTTP_c                 C   s   || _ || _d S N)environprefix)selfr"   r#    r%   Z/var/www/html/pro-man-master/venv/lib/python3.10/site-packages/sentry_sdk/tracing_utils.py__init__A   s   
zEnvironHeaders.__init__c                 C   s   | j | j|dd   S N-_)r"   r#   replaceupper)r$   keyr%   r%   r&   __getitem__J      zEnvironHeaders.__getitem__c                 C   s   t dd t| D S )Nc                 s   s    | ]}d V  qdS )   Nr%   ).0r*   r%   r%   r&   	<genexpr>P   s    z)EnvironHeaders.__len__.<locals>.<genexpr>)sumiterr$   r%   r%   r&   __len__N   s   zEnvironHeaders.__len__c                 c   sP    | j D ]!}t|tsq|dd }|| jsq|t| jd  V  qd S r(   )r"   
isinstancestrr+   r,   
startswithr#   len)r$   kr%   r%   r&   __iter__R   s   

zEnvironHeaders.__iter__N)r    )__name__
__module____qualname__r'   r.   r6   r<   r%   r%   r%   r&   r   @   s    
	r   c                 C   s:   | du rdS t | dduo| ddup| dduS )z}
    Returns True if either traces_sample_rate or traces_sampler is
    defined and enable_tracing is set and not false.
    NFenable_tracingtraces_sample_ratetraces_sampler)boolget)optionsr%   r%   r&   has_tracing_enabled_   s   rF   Fmanualc                 c   s    t  jd ddr|r|d gkrd }|dkrd}nd }d }t| |}i }|d ur/||d< |d ur7||d< |r=d|d	< |rG| d urG| |d
< t  t j|d|d W d    n1 s]w   Y  t jtj	||d}|
 D ]
\}	}
||	|
 qp|V  W d    d S 1 sw   Y  d S )N_experimentsrecord_sql_paramsFpyformatformatz	db.paramszdb.paramstyleTzdb.executemanyz	db.cursorquery)messagecategorydata)opnameorigin)
sentry_sdk
get_clientrE   rD   _format_sqlr   add_breadcrumb
start_spanr   DBitemsset_data)cursorrL   params_list
paramstyleexecutemanyrecord_cursor_reprspan_originrO   spanr;   vr%   r%   r&   record_sql_queriesq   s@   
"rc   c                 C   s   |j tjkr| j|jdd|jd d S |j tjkrZd }|jt	j
}|rAd|  kr.dkr3n nd}nd|  kr=dkrAn nd}|rO| jd	d
|j|d d S | jd	d
|jd d S |j dkrl| jdd|j|jd d S d S )Nredis)rM   typerN   rO   i  iW  errori  i  warninghttphttplib)re   rN   rO   level)re   rN   rO   
subprocess)re   rN   rM   rO   )rP   r   DB_REDISrV   description_tagsHTTP_CLIENT_datarD   r   HTTP_STATUS_CODE)scopera   rj   status_coder%   r%   r&   "maybe_create_breadcrumbs_from_span   s2   




rt   c                 C   s    z| j jW S  ty   Y d S w r!   )f_codeco_filename	Exception)framer%   r%   r&   _get_frame_module_abs_path   s
   
ry   c                 C   s6   t ||}t|pt ||}|  o|pt||o| S r!   )r   r   r   )is_sentry_sdk_frame	namespacein_app_includein_app_excludeabs_pathproject_rootshould_be_includedshould_be_excludedr%   r%   r&   _should_be_included   s   


r   c                 C   sD  t  }| s
dS | jdu s| jdu rdS |jdd}|s!dS | j| j }|jdd}|tdd |k}|s;dS |jd }|jd	}|jd
}t	 }	|	durt
|	}
z|	jd}W n tyk   d}Y nw |duot|d}t|||||
|d}|rn	|	j}	|	dusTd}	|	durz|	j}W n ty   d}Y nw |dur| tj|	j z|	jd}W n ty   d}Y nw |dur| tj| t
|	}|dur|durt||}n|dur||r||dtj}n|}| tj| z|	jj}W n ty   d}Y nw |dur | tj|	jj dS dS dS )zB
    Adds OTel compatible source code information to the span
    Nenable_db_query_sourceTdb_query_source_threshold_msr   r0   )millisecondsr   r|   r}   r=   zsentry_sdk.)rz   r{   r|   r}   r~   r    )rS   rT   	is_active	timestampstart_timestamprE   rD   r   sys	_getframery   	f_globalsrw   r9   r   f_backf_linenorZ   r   CODE_LINENOCODE_NAMESPACEr   r+   lstripossepCODE_FILEPATHru   co_nameCODE_FUNCTION)ra   clientshould_add_query_sourceduration	threshold
slow_queryr   r|   r}   rx   r~   r{   rz   r   linenofilepathin_app_pathcode_functionr%   r%   r&   add_query_source   s   



r   c                 C   s   | sdS |  dr| dr| dd } t| }|sdS | \}}}d}|r0dt|d}|r:dt|d}|r@|d	k}|||d
S )zL
    Given a `sentry-trace` header string, return a dictionary of data.
    Nz00-z-00   z{:032x}   z{:016x}0)trace_idparent_span_idparent_sampled)r9   endswithSENTRY_TRACE_REGEXmatchgroupsrK   int)headerr   r   r   sampled_strr   r%   r%   r&   extract_sentrytrace_data8  s&   
r   c                 C   sX   d }zt | dr| |}t|tr|| jj}W n ty%   d }Y nw |p+t|S )Nmogrify)	hasattrr   r7   bytesdecode
connectionencodingrw   r   )r[   sqlreal_sqlr%   r%   r&   rU   X  s   


rU   c                   @   s   e Zd ZdZdZ					dddZedd Zedd	 Z	e	j
d
d	 Z	edd Zej
dd Zdd Zdd Zdd Zdd ZdS )PropagationContextzJ
    The PropagationContext represents the data of a trace in Sentry.
    	_trace_id_span_idr   r   dynamic_sampling_contextNc                 C   s*   || _ 	 || _	 || _	 || _	 || _d S r!   r   )r$   r   span_idr   r   r   r%   r%   r&   r'   y  s   	zPropagationContext.__init__c                 C   sz   d }t |}|t}|rt }t| |_|t}|r3t|}|d ur3|d u r.t }|	| |d ur;|
  |S r!   )normalize_incoming_datarD   BAGGAGE_HEADER_NAMEr   Baggagefrom_incoming_headerr   SENTRY_TRACE_HEADER_NAMEr   update_fill_sample_rand)clsincoming_datapropagation_contextnormalized_databaggage_headersentry_trace_headersentrytrace_datar%   r%   r&   from_incoming_data  s(   


z%PropagationContext.from_incoming_datac                 C   s   | j s	t j| _ | j S )z!The trace id of the Sentry trace.)r   uuiduuid4hexr5   r%   r%   r&   r     s   zPropagationContext.trace_idc                 C   
   || _ d S r!   )r   r$   valuer%   r%   r&   r        
c                 C   s    | j st jdd | _ | j S )z+The span id of the currently executed span.r   N)r   r   r   r   r5   r%   r%   r&   r     s   zPropagationContext.span_idc                 C   r   r!   )r   r   r%   r%   r&   r     r   c              	   C   s8   |  D ]\}}zt| || W q ty   Y qw dS )zU
        Updates the PropagationContext with data from the given dictionary.
        N)rY   setattrAttributeError)r$   
other_dictr-   r   r%   r%   r&   r     s   zPropagationContext.updatec                 C   s   d | j| j| j| j| jS )Nzm<PropagationContext _trace_id={} _span_id={} parent_span_id={} parent_sampled={} dynamic_sampling_context={}>)rK   r   r   r   r   r   r5   r%   r%   r&   __repr__  s   zPropagationContext.__repr__c              
   C   s   | j du rdS tt| j d}|dur d|  krdk r dS  tt| j d}t| j|\}}zt| j||fd}W n tyS   t	
d| j d| d	 Y dS w |d
| j d< dS )aJ  
        Ensure that there is a valid sample_rand value in the dynamic_sampling_context.

        If there is a valid sample_rand value in the dynamic_sampling_context, we keep it.
        Otherwise, we generate a sample_rand value according to the following:

          - If we have a parent_sampled value and a sample_rate in the DSC, we compute
            a sample_rand value randomly in the range:
                - [0, sample_rate) if parent_sampled is True,
                - or, in the range [sample_rate, 1) if parent_sampled is False.

          - If either parent_sampled or sample_rate is missing, we generate a random
            value in the range [0, 1).

        The sample_rand is deterministically generated from the trace_id, if present.

        This function does nothing if there is no dynamic_sampling_context.
        Nsample_randr   r0   sample_rateintervalz5Could not backfill sample_rand, since parent_sampled=z and sample_rate=..6f)r   r   floatrD   _sample_rand_ranger   _generate_sample_randr   
ValueErrorr   debug)r$   r   r   lowerr,   r%   r%   r&   r     s0   

z$PropagationContext._fill_sample_randc                 C   s   | j du rdS | j dS )zRConvenience method to get the sample_rand value from the dynamic_sampling_context.Nr   )r   rD   r5   r%   r%   r&   _sample_rand  s   
zPropagationContext._sample_rand)NNNNN)r=   r>   r?   __doc__	__slots__r'   classmethodr   propertyr   setterr   r   r   r   r   r%   r%   r%   r&   r   l  s.    



	



6r   c                   @   s   e Zd ZdZdZdZedZ		dddZ	e
d	d
ddZe
dd Ze
dd Zdd Zdd ZdddZedd Zdd Zdd Zd	S ) r   aF  
    The W3C Baggage header information (see https://www.w3.org/TR/baggage/).

    Before mutating a `Baggage` object, calling code must check that `mutable` is `True`.
    Mutating a `Baggage` object that has `mutable` set to `False` is not allowed, but
    it is the caller's responsibility to enforce this restriction.
    sentry_itemsthird_party_itemsmutablezsentry-z^sentry-r   Tc                 C   s   || _ || _|| _d S r!   r   )r$   r   r   r   r%   r%   r&   r'   -  s   
zBaggage.__init__N)r   c          
   	   C   s   i }d}d}|rU| dD ]G}d|vrqt 5 | }| d\}}tj|r;t| dd }	t|||	< d}n
||r@dnd| 7 }W d   n1 sOw   Y  q|durat||d	< d}t|||S )
zF
        freeze if incoming header already has sentry baggage
        r   T,=r)   r0   FNr   )splitr   stripr   SENTRY_PREFIX_REGEXr   r   r8   )
r   r   r   r   r   r   itemr-   valbaggage_keyr%   r%   r&   r   7  s,   
zBaggage.from_incoming_headerc                 C   s   i }d}d}t  }| r|jd u rt|S |j}|j}|d ur&|j|d< |dr1|d |d< |dr<|d |d< |drJt|d j	|d< |drWt
|d |d	< t|||S )
Nr   Fr   environmentreleasedsn
public_keyrA   r   )rS   rT   r   _propagation_contextr   rE   r   rD   r   r   r8   )r   rr   r   r   r   r   rE   r   r%   r%   r&   from_options[  s&   




zBaggage.from_optionsc                 C   s   t  }i }| st|S |jpi }|j|d< |jd|d< |dr*|d |d< |dr5|d |d< |drCt|d j	|d< |j
rP|jtvrP|j
|d< |jd	ur\t|j|d
< |jd	urj|jrfdnd|d< |jrx|jjrx||jj t|ddS )z
        Populate fresh baggage entry with sentry_items and make it immutable
        if this is the head SDK which originates traces.
        r   r   r   r   r   r   r   transactionNr   truefalsesampledFr   )rS   rT   r   r   rE   r   r   rD   r   r   rQ   sourceLOW_QUALITY_TRANSACTION_SOURCESr   r8   r   _baggager   r   )r   r   r   r   rE   r%   r%   r&   populate_from_transaction|  s0   








z!Baggage.populate_from_transactionc                 C   s
   d| _ d S )NFr   r5   r%   r%   r&   freeze  s   
zBaggage.freezec                 C   s$   i }| j  D ]\}}|||< q|S r!   )r   rY   )r$   r   r-   r   r%   r%   r&   r     s   
z Baggage.dynamic_sampling_contextFc              	   C   s   g }| j  D ]+\}}t  tjt| d tt| }|| W d    n1 s-w   Y  q|r;|| j d	|S )Nr   r   )
r   rY   r   r   SENTRY_PREFIXr   r8   appendr   join)r$   include_third_partyrY   r-   r   r   r%   r%   r&   	serialize  s   
zBaggage.serializec                 C   s   d dd | dD S )zRemove Sentry baggage from the given header.

        Given a Baggage header, return a new Baggage header with all Sentry baggage items removed.
        r   c                 s   s$    | ]}t j| s|V  qd S r!   )r   r   r   r   )r1   r   r%   r%   r&   r2     s    
z/Baggage.strip_sentry_baggage.<locals>.<genexpr>)r  r   )r   r%   r%   r&   strip_sentry_baggage  s
   zBaggage.strip_sentry_baggagec                 C   s:   t t| jd}|durd|  krdk r|S  dS dS )zConvenience method to get the sample_rand value from the sentry_items.

        We validate the value and parse it as a float before returning it. The value is considered
        valid if it is a float in the range [0, 1).
        r   N              ?)r   r   r   rD   )r$   r   r%   r%   r&   r     s
   zBaggage._sample_randc                 C   s   d| j dd d| j dS )Nz
<Baggage "T)r	  z", mutable=>)r
  r   r5   r%   r%   r&   r     r/   zBaggage.__repr__)r   T)F)r=   r>   r?   r   r   r  recompiler   r'   r   r   r   r  r  r   r
  staticmethodr  r   r   r%   r%   r%   r&   r     s,    


#
 
.
	
r   c                 C   s&   | j d }t| |rdS t||ddS )zy
    Returns True if url matches trace_propagation_targets configured in the given client. Otherwise, returns False.
    trace_propagation_targetsFT)substring_matching)rE   r   r   )r   urlr  r%   r%   r&   should_propagate_trace  s   

r  c                 C   sH   i }|   D ]\}}|dr|dd }|dd }|||< q|S )z
    Normalizes incoming data so the keys are all lowercase with dashes instead of underscores and stripped from known prefixes.
    r       Nr*   r)   )rY   r9   r+   r   )r   rO   r-   r   r%   r%   r&   r     s   

r   c                    s$   ddl m  fdd}|S )a  
    Create a span decorator that can wrap both sync and async functions.

    :param op: The operation type for the span.
    :type op: str or :py:class:`sentry_sdk.consts.OP` or None
    :param name: The name of the span.
    :type name: str or None
    :param attributes: Additional attributes to set on the span.
    :type attributes: dict 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`
    r   )should_send_default_piic                    s   t   fdd}zt |_W n	 ty!   Y nw t   fdd}zt |_W n	 tyC   Y nw t rK|S |S )zD
        Decorator to create a span for the given function.
        c            	   	      s   t  }|d u rtdt | i |I d H S pt}p'tp'd}t||} }|j||d,}| p>i  t|||| | | i |I d H }t	||| |W  d    S 1 sgw   Y  d S NzbCannot create a child span for %s. Please start a Sentry transaction before calling this function.r   )rP   rQ   
get_current_spanr   r   r   _get_span_op_get_span_namestart_childupdate_data_set_input_attributes_set_output_attributes	argskwargscurrent_spanspan_opfunction_name	span_namesend_piira   result
attributesfrQ   rP   r  templater%   r&   async_wrapper!  s2   $zDcreate_span_decorator.<locals>.span_decorator.<locals>.async_wrapperc            	   	      s   t  }|d u rtdt | i |S pt}p#tp#d}t||} }|j||d)}| p:i  t|||| | | i |}t	||| |W  d    S 1 s`w   Y  d S r  r  r!  r*  r%   r&   sync_wrapperG  s0   $zCcreate_span_decorator.<locals>.span_decorator.<locals>.sync_wrapper)	functoolswrapsinspect	signature__signature__rw   iscoroutinefunction)r,  r.  r/  r+  rQ   rP   r  r-  )r,  r&   span_decorator  s"     
z-create_span_decorator.<locals>.span_decorator)sentry_sdk.scoper  )rP   rQ   r+  r-  r7  r%   r6  r&   create_span_decorator  s   Wr9  c                 C   s   | pt  } | j}|S )zU
    Returns the currently active span if there is one running, otherwise `None`
    )rS   get_current_scopera   )rr   r$  r%   r%   r&   r  u  s   r  c                 C   sB   | pt  } | dur| tj | jdur| jtj dS dS dS )z
    Set the status of the current or given span to ERROR.
    Also sets the status of the transaction (root span) to ERROR.
    N)r  
set_statusr	   ERRORcontaining_transaction)ra   r%   r%   r&   set_span_errored  s   

r>  r  r  r   c                C   sl   |\}}||k st dt| }t|d }t|d }z|||}W |d S  t y5   |}Y |d S w )a  Generate a sample_rand value from a trace ID.

    The generated value will be pseudorandomly chosen from the provided
    interval. Specifically, given (lower, upper) = interval, the generated
    value will be in the range [lower, upper). The value has 6-digit precision,
    so when printing with .6f, the value will never be rounded up.

    The pseudorandom number generator is seeded with the trace ID.
    z/Invalid interval: lower must be less than upperi@B )r   r   r   	randrange)r   r   r   r,   rnglower_scaledupper_scaledsample_rand_scaledr%   r%   r&   r     s   r   c                 C   s,   | du s|du r
dS | du rd|fS |dfS )z
    Compute the lower (inclusive) and upper (exclusive) bounds of the range of values
    that a generated sample_rand value must fall into, given the parent_sampled and
    sample_rate values.
    Nr?  Tr  r  r%   )r   r   r%   r%   r&   r     s
   r   c                 C   sT   d}t | tr| |}|S t| |r(zt| |}W |S  ty'   d}Y |S w |S )z
    Gets a value from a source object. The source can be a dict or an object.
    It is checked for dictionary keys and object attributes.
    N)r7   dictrD   r   getattrrw   )r  r-   r   r%   r%   r&   
_get_value  s   


rG  c                 C   s   |}| t jkr/d}|r"dD ]}||r!t|| tr!|| } nq|r+d| }|S d}|S | t jkr;d| }|S | t jkrEd| }|S )zF
    Get the name of the span based on the template and the name.
    N)model
model_namezchat chatzinvoke_agent zexecute_tool )r
   AI_CHATrD   r7   r8   AI_AGENTAI_TOOL)r-  rQ   r#  r'  rH  r-   r%   r%   r&   r    s&   




r  c                 C   s2   t jtjt jtjt jtji}|| tj	}t
|S )z>
    Get the operation of the span based on the template.
    )r
   rK  r   GEN_AI_CHATrL  GEN_AI_INVOKE_AGENTrM  GEN_AI_EXECUTE_TOOLrD   FUNCTIONr8   )r-  mappingrP   r%   r%   r&   r    s   r  c                    s<  i  | t jt jt jfv r|tjtftjtftjtftjtftjt	ftj
tftjtftjtftjtftjt	fd
 fdd}t| D ]7\}}|dkr_t|tr_ tjg d|d qD|dkrvt|trv tjg d|d qD||| qD| t jkr|rt||d	 tj< tj v rt tj  tj<  S )
z;
    Get input attributes for the given span template.
    )
rH  rI  agent
agent_name
max_tokensfrequency_penaltypresence_penaltytemperaturetop_ptop_kc                    s>   | v r|  \}}|d urt ||r| |< d S d S d S d S r!   )r7   )r-   r   	attribute	data_typer+  rR  r%   r&   _set_from_key  s   z,_get_input_attributes.<locals>._set_from_keypromptuser)rolecontentsystem_promptsystem)r"  r#  )r
   rL  rM  rK  r   GEN_AI_REQUEST_MODELr8   GEN_AI_AGENT_NAMEGEN_AI_REQUEST_MAX_TOKENSr    GEN_AI_REQUEST_FREQUENCY_PENALTYr   GEN_AI_REQUEST_PRESENCE_PENALTYGEN_AI_REQUEST_TEMPERATUREGEN_AI_REQUEST_TOP_PGEN_AI_REQUEST_TOP_KlistrY   r7   
setdefaultGEN_AI_REQUEST_MESSAGESr  r   GEN_AI_TOOL_INPUT)r-  r(  r"  r#  r^  r-   r   r%   r]  r&   _get_input_attributes  sF   


rq  c                    s:   i   fdd}|t jd |t jd |t jd  S )z
    Get usage attributes.
    c                    s2   |D ]}t |}|d urt|tr| | < qd S r!   )rG  r7   r   )r[  keysr-   r   r+  usager%   r&   _set_from_keys6  s   
z-_get_usage_attributes.<locals>._set_from_keys)prompt_tokensinput_tokens)completion_tokensoutput_tokens)total_tokens)r   GEN_AI_USAGE_INPUT_TOKENSGEN_AI_USAGE_OUTPUT_TOKENSGEN_AI_USAGE_TOTAL_TOKENS)rt  ru  r%   rs  r&   _get_usage_attributes/  s   r~  c           	      C   s  i }| t jt jt jfv rqt Z |g}t|d}|| t|d}t|d}|| |D ]}|dur;|t| q.t|d}|durOt	|t
rO||tj< t|d}|durbt	|t
rb||tj< W d   n1 slw   Y  | t jkr|rt||tj< |S )z<
    Get output attributes for the given span template.
    rt  metadataNrH  rI  )r
   rL  rM  rK  r   rG  r  r   r~  r7   r8   r   GEN_AI_RESPONSE_MODELr   GEN_AI_TOOL_OUTPUT)	r-  r(  r)  r+  usage_candidatesrt  metausage_candidaterI  r%   r%   r&   _get_output_attributesM  s0   








r  c           	      C   s   i }|t jkrtjdtj|i}n$|t jkrtjdi}n|t jkr4tjdtj|i}|j}|dur4||tj	< |
t|||| | |pCi  dS )a  
    Set span input attributes based on the given span template.

    :param span: The span to set attributes on.
    :param template: The template to use to set attributes on the span.
    :param send_pii: Whether to send PII data.
    :param f: The wrapped function.
    :param args: The arguments to the wrapped function.
    :param kwargs: The keyword arguments to the wrapped function.
    invoke_agentrJ  execute_toolN)r
   rL  r   GEN_AI_OPERATION_NAMErf  rK  rM  GEN_AI_TOOL_NAMEr   GEN_AI_TOOL_DESCRIPTIONr   rq  r  )	ra   r-  r(  rQ   r,  r"  r#  r+  	docstringr%   r%   r&   r  t  s"   



r  c                 C   s   |  t|||p	i  dS )a%  
    Set span output attributes based on the given span template.

    :param span: The span to set attributes on.
    :param template: The template to use to set attributes on the span.
    :param send_pii: Whether to send PII data.
    :param result: The result of the wrapped function.
    N)r  r  )ra   r-  r(  r)  r%   r%   r&   r     s   
r   )r   r  r   )Span)FrG   r!   )Q
contextlibr0  r2  r   r  r   collections.abcr   datetimer   randomr   urllib.parser   r   r   rS   sentry_sdk.constsr   r   r	   r
   sentry_sdk.utilsr   r   r   r   r   r   r   r   r   r   r   r   r   typingr   r   r   r   r   r   typesr   r  r   base64_strippedr   rF   contextmanagerrc   rt   ry   r   r   r   rU   r   r   r  r   DEFAULTr9  r  r>  r   r   rG  r  r  rq  r~  r  r  r   sentry_sdk.tracingr   r  r   r  r%   r%   r%   r&   <module>   s    <
/ [  4 J


p

 
9'%