Viewing File: /opt/hc_python/lib/python3.12/site-packages/sentry_sdk/__pycache__/tracing_utils.cpython-312.pyc

�

_�*jr�����ddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZmZm
Z
ddlmZddlmZmZ	ddlmZddlmZddlZddlmZmZmZdd	lmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)erdd
l*m+Z+ddlm,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2ddl3m4Z4ejjd
�Z6dZ7Gd�de	�Z8ddde9fd�Z:ddde9fd�Z;ddde9fd�Z<ejz		dpddddddddde9de9d e>dd!fd"��Z?						dqd&�Z@drd'�ZAd(e9d)dd*d+d,d+d-dd.dde9fd/�ZB										dsd0�ZC				dtd1�ZD				dtd2�ZE				dud3�ZFddd4e>ddfd5�ZGGd6�d7�ZHGd8�d9�ZId:d;d<e>de9fd=�ZJdvd>�ZKdddej�f									dwdB�ZM			dxd?dd@ddCe9ddfdD�ZN	dy			dzdE�ZOdFdG�dHddIdJdePfdK�ZQ						d{dL�ZRdMddNe>ddOfdP�ZS	dydAdQd?e>dRdde>fdS�ZTdAdQde>fdT�ZUdAdQdUe9dVdWdRdXddXf
dY�ZVd|dZ�ZWdAdQdUe9d[dddXfd\�ZXd%d]dAdQdUe9d?e>d^ddVdWdRdXddfd_�ZYd%d]dAdQdUe9d[dddf
d`�ZZdadbde9fdc�Z[dddedfe>ddfdg�Z\d?e>d@dhd#d$ddifdj�Z]d?e>d@dhde9fdk�Z^ddll_m`Z`maZaddml_mbZcddnldmeZemfZfmgZgmhZherddoldmhZhyy#e$r
ddlmZY��'wxYw)}�N)�Mapping�MutableMapping)�datetime�	timedelta�timezone)�Random)�quote�unquote)�Pattern)�
TYPE_CHECKING)�OP�SPANDATA�SPANTEMPLATE)
�_is_external_source�_is_in_project_root�_module_in_list�capture_internal_exceptions�filename_for_module�
is_sentry_url�is_valid_sample_rate�logger�match_regex_list�qualname_from_function�	safe_repr�	to_string�try_convert)�	FrameType)�Any�Dict�	Generator�Iterator�Optional�Tuple�Union)�
Attributesz5^[ 	]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ 	]*$z(([a-zA-Z0-9+/]{4})*([a-zA-Z0-9+/]{2,3})?c�H�eZdZ	ddddeddfd�Zdeddfd	�Zdefd
�Zd
d�Zy)�EnvironHeaders�environzMapping[str, str]�prefix�returnNc� �||_||_y�N)r(r))�selfr(r)s   �G/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/tracing_utils.py�__init__zEnvironHeaders.__init__Es��
�������key�
Optional[Any]c�v�|j|j|jdd�j�zS�N�-�_)r(r)�replace�upper)r-r1s  r.�__getitem__zEnvironHeaders.__getitem__Ms.���|�|�D�K�K�#�+�+�c�3�*?�*E�*E�*G�G�H�Hr0c�8�td�t|�D��S)Nc3� K�|]}d���y�w)�N�)�.0r6s  r.�	<genexpr>z)EnvironHeaders.__len__.<locals>.<genexpr>Qs����)�j��1�j�s�)�sum�iter�r-s r.�__len__zEnvironHeaders.__len__Ps���)�d�4�j�)�)�)r0c#�K�|jD]i}t|t�s�|jdd�j	�}|j|j�s�P|t|j�d���ky�wr4)r(�
isinstance�strr7r8�
startswithr)�len)r-�ks  r.�__iter__zEnvironHeaders.__iter__Ssd�������A��a��%���	�	�#�s�#�)�)�+�A��<�<����,���C����$�&�'�'��s�A:A<)�HTTP_)r*zGenerator[str, None, None])	�__name__�
__module__�__qualname__rFr/r9�intrCrJr=r0r.r'r'DsO����$����
�	�I�s�I��I�*��*�	(r0r'�options�Optional[Dict[str, Any]]r*c��|�yt|jd�duxr(|jd�duxs|jd�du�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�rPs r.�has_tracing_enabledrY_sY��
�������$�%�U�2�	
��K�K�,�-�T�9�
9��{�{�+�,�D�8�	�r0�Optional[dict[str, Any]]c�V�|�y|jd�xsijd�dk(S)NF�_experiments�trace_lifecycle�stream)rWrXs r.�has_span_streaming_enabledr_ps/������K�K��'�-�2�2�2�3D�E��Q�Qr0c�J�|�y|jdd�xrt|�S)NT�stream_gen_ai_spansF)rWr_rXs r.�should_truncate_gen_ai_inputrbws5������{�{��u���2�(��1�
1�2r0�cursorr�query�params_list�
paramstyle�
Optional[str]�executemany�record_cursor_repr�span_originzUGenerator[Union[sentry_sdk.tracing.Span, sentry_sdk.traces.StreamedSpan], None, None]c#�K�tj�}|jdjdd�r|r|dgk(rd}|dk(rd}nd}d}t	||�}i}|�||d<|�||d<|rd|d	<|r|�||d
<t�5tj|d|��ddd�t|j�rDtjj|�d
n||tjd���5}	|	��ddd�ytjtj||��5}	|j�D]\}
}|	j|
|��|	��ddd�y#1swY��xYw#1swYyxYw#1swYyxYw�w)Nr\�record_sql_paramsF�pyformat�formatz	db.paramsz
db.paramstyleTzdb.executemanyz	db.cursorrd)�message�category�dataz<unknown SQL query>)z
sentry.originz	sentry.op)�name�
attributes)�oprr�origin)�
sentry_sdk�
get_clientrPrW�_format_sqlr�add_breadcrumbr_�traces�
start_spanr
�DB�items�set_data)rcrdrerfrhrirj�clientrq�spanrI�vs            r.�record_sql_queriesr��s������
"�
"�
$�F�
�~�~�n�%�)�)�*=�u�E��k�d�V�3��K���#�!�J����
����&�E�
�D���'��[���� *��_���!%��
���f�0�"��[��	$�	&��!�!�%�'��M�
'�"�&�.�.�1�
�
�
�
)�
)�*/�-�&�U�!,��U�U��*�
���J�
�
��
"�
"��u�u���
���
�
����1��
�
�a��#�%��J�
�
�
'�	&��
�
��
�
�sO�BE>�E�AE>�.E&�3/E>�"/E2�	E>�E#�E>�&E/�+E>�2E;�7E>�scope�sentry_sdk.Scoper�c�\�|jtjk(r*|j|jdd|j
��y|jtjk(r�d}|jjtj�}|r!d|cxkrdkrnnd}nd|cxkrdkrnnd}|r |jd	d
|j|��y|jd	d
|j��y|jd
k(r*|jd
d
|j|j��yy)N�redis)ro�typerprqi�iW�errori�i��warning�http�httplib)r�rprq�level)r�rprq�
subprocess)r�rprorq)rtr
�DB_REDISry�description�_tags�HTTP_CLIENT�_datarWr�HTTP_STATUS_CODE)r�r�r��status_codes    r.�"maybe_create_breadcrumbs_from_spanr��s���w�w�"�+�+��
����$�$�7�W�4�:�:�	�	
�
���B�N�N�	"����j�j�n�n�X�%>�%>�?����k�(�S�(�����*�s�*�!���� � ��i�d�j�j��
!�
�
� � �f�y�t�z�z� �R�	
���L�	 �
����!��$�$����		�	
�
!r0c�N�	|jjS#t$rYywxYwr,)�f_code�co_filename�	Exception)�frames r.�_get_frame_module_abs_pathr��s)����|�|�'�'�'������s��	$�$�is_sentry_sdk_frame�	namespace�in_app_include�Optional[list[str]]�in_app_exclude�abs_path�project_rootc��t||�}t|�xst||�}|xr|xst||�xr|Sr,)rrr)r�r�r�r�r�r��should_be_included�should_be_excludeds        r.�_should_be_includedr��s[��)��N�C��,�X�6��/��>�;��#�"���	T���,�7�R�@R�<R�r0c��tj�}|�at|�}	|jj	d�}|duxr|j
d�}t||||||��}|rn|j}|��ad}|���	|j}	|	�Ct|t�r!|jtj|	�n|jd|	�	|jj	d�}|�Qt|t�r!|jtj |�n |jtj |�t|�}
|
��|�
t#||
�}nE|�A|
j
|�r0|
j%|d�j't(j*�}n|
}t|t�r!|jtj,|�n|�|jd|�	|j.j0}|�zt|t�r5|jtj2|j.j0�y|jtj2|j.j0�yyy#t
$rd}Y��IwxYw#t
$rd}	Y��wxYw#t
$rd}Y���wxYw#t
$rd}Y��wxYw)zB
    Adds OTel compatible source code information to the span
    NrLzsentry_sdk.)r�r�r�r�r�r�zcode.line.number�zcode.file.path)�sys�	_getframer��	f_globalsrWr�rGr��f_back�f_linenorE�Spanr~r�CODE_LINENO�
set_attribute�CODE_NAMESPACErr7�lstrip�os�sep�
CODE_FILEPATHr��co_name�
CODE_FUNCTION)
r�r�r�r�r�r�r�r�r��lineno�filepath�in_app_path�
code_functions
             r.�
add_sourcer��s���'*�m�m�o�E�
�
�-�e�4��	�).���)<�)<�Z�)H�I�(�t�3�
�	�8L�8L��9
��1� 3��)�)��%�

��������/�
�2��
��	��^�^�F����$��%��
�
�h�2�2�F�;��"�"�#5�v�>�	����+�+�J�7�I�� ��$��%��
�
�h�5�5�y�A��"�"�8�#:�#:�I�F�-�e�4�����$�1�)�X�F���)�h�.A�.A�,�.O�&�.�.�|�R�@�G�G����O��&���$��%��
�
�h�4�4�k�B��*��&�&�'7��E�	!�!�L�L�0�0�M��$��$��%��
�
�h�4�4�e�l�l�6J�6J�K��"�"�8�#9�#9�5�<�<�;O�;O�P�	%�S��/�	��I�	��4�	��F�	���	��I�	��2�	!� �M�	!�sG�I9�>J�J�%J/�9J�J�J�J�J,�+J,�/J=�<J=c��tj�}|j�syt|t�r
|j
�y|j�y|jjdd�}|syt|t�r
|j}n|j
}|xs#tjtj�}||jz
}|jjdd�}|td��z|kD}|syt!||jd|jjd	�|jjd
���y)zO
    Adds OTel compatible source code information to a database query span
    N�enable_db_query_sourceT�db_query_source_threshold_msrr<��millisecondsr�r�r��r�r�r�r��rvrw�	is_activerEr��	timestamp�start_timestamprPrW�StreamedSpan�
end_timestampr�nowr�utcrr�)r�r�should_add_query_sourcer��duration�	threshold�
slow_querys       r.�add_query_sourcer�Ks���
"�
"�
$�F�������$����>�>�!�����#��$�n�n�0�0�1I�4�P��"���$��%��*�*�
����
�!�?�X�\�\�(�,�,�%?�M��t�3�3�3�H����"�"�#A�1�E�I��I�1�5�5�	�A�J����
��^�^�N�3��~�~�)�)�*:�;��~�~�)�)�*:�;�	r0c��tj�}|j�syt|t�r
|j
�y|j�y|jjdd�}|syt|t�r
|j}n|j
}|xs#tjtj�}||jz
}|jjdd�}|td��z|kD}|syt!||jd|jjd	�|jjd
���y)z]
    Adds OTel compatible source code information to a span for an outgoing HTTP request
    N�enable_http_request_sourceT� http_request_source_threshold_msrr<r�r�r�r�r�r�)r�r�should_add_request_sourcer�r�r�r�s       r.�add_http_request_sourcer�ys���
"�
"�
$�F�������$����>�>�!�����#�� &��� 2� 2�3O�QU� V��$���$��%��*�*�
����
�!�?�X�\�\�(�,�,�%?�M��t�3�3�3�H����"�"�#E�q�I�I��I�1�5�5�	�A�J����
��^�^�N�3��~�~�)�)�*:�;��~�~�)�)�*:�;�	r0c�@�|sy|jd�r|jd�r|dd}tj|�}|sy|j	�\}}}d}|rdjt
|d��}|rdjt
|d��}|r|d	k7}|||d
�S)zL
    Given a `sentry-trace` header string, return a dictionary of data.
    Nz00-z-00����z{:032x}�z{:016x}�0)�trace_id�parent_span_id�parent_sampled)rG�endswith�SENTRY_TRACE_REGEX�match�groupsrnrO)�headerr�r�r��sampled_strr�s      r.�extract_sentrytrace_datar��s�����
�����F�O�O�E�$:���"����$�$�V�,�E���,1�L�L�N�)�H�n�k��N���#�#�C��"�$5�6���"�)�)�#�n�b�*A�B���$��+���(�(��r0�sqlc���d}	t|d�rF|j|�}t|t�r%|j	|j
j�}|xst|�S#t$rd}Y�wxYw)N�mogrify)	�hasattrr�rE�bytes�decode�
connection�encodingr�r)rcr��real_sqls   r.rxrx�so���H���6�9�%��~�~�c�*�H��(�E�*�#�?�?�6�+<�+<�+E�+E�F���%�y��~�%�������s�AA%�%A3�2A3c�H�eZdZdZdZ						d													dd�Ze				dd��Zede	fd��Z
e
jde	ddfd	��Z
ede	fd
��Zejde	ddfd��Zedd��Z
de	fd
�Zdd�Zdd�Zdd�Z				dd�Zde	fd�Zdd�Zdd�Zy)�PropagationContextzJ
    The PropagationContext represents the data of a trace in Sentry.
    )�	_trace_id�_span_idr�r��baggage�custom_sampling_contextNr*c��||_	||_	||_	||_	||_		|�|�t|�|_d|_yr,)r�r�r�r�r��Baggager�)r-r��span_idr�r��dynamic_sampling_contextr�s       r.r/zPropagationContext.__init__�se��"���/���
�:�,���	H�-���	Q����P�N��?�7�C�"�#;�<�D�L�CG��$r0c�B�t�}t|�}|jt�}t	|�}|�|S|jt
�}|rtj|�nd}t|�s|S|j|�|r||_
|j�|Sr,)r��normalize_incoming_datarW�SENTRY_TRACE_HEADER_NAMEr��BAGGAGE_HEADER_NAMEr��from_incoming_header�_should_continue_trace�updater��_fill_sample_rand)�cls�
incoming_data�propagation_context�normalized_data�sentry_trace_header�sentrytrace_data�baggage_headerr�s        r.�from_incoming_dataz%PropagationContext.from_incoming_data	s���1�2��1�-�@��-�1�1�2J�K��3�4G�H���#�&�&�(�,�,�-@�A��<J�G�(�(��8�PT�	�&�g�.�&�&��"�"�#3�4��*1��'��-�-�/�"�"r0c�x�|js#tj�j|_|jS)z!The trace id of the Sentry trace.)r��uuid�uuid4�hexrBs r.r�zPropagationContext.trace_id's(���~�~�!�Z�Z�\�-�-�D�N��~�~�r0�valuec��||_yr,)r��r-rs  r.r�zPropagationContext.trace_id0s	����r0c�~�|js&tj�jdd|_|jS)z+The span id of the currently executed span.r�N)r�rr	r
rBs r.r�zPropagationContext.span_id4s/���}�}� �J�J�L�,�,�R�S�1�D�M��}�}�r0c��||_yr,)r�r
s  r.r�zPropagationContext.span_id<s	����
r0c�>�|j�j�Sr,)�get_baggager�rBs r.r�z+PropagationContext.dynamic_sampling_context@s�����!�:�:�<�<r0c�8�|j�d|j��S)Nr5)r�r�rBs r.�to_traceparentz!PropagationContext.to_traceparentDs���-�-���$�,�,��0�0r0c�f�|j�tj|�|_|jSr,)r�r��!populate_from_propagation_contextrBs r.rzPropagationContext.get_baggageGs(���<�<��"�D�D�T�J�D�L��|�|�r0c#�K�t|j�f��|j�j�}|rt|f��yy�w)zw
        Creates a generator which returns the propagation_context's ``sentry-trace`` and ``baggage`` headers.
        N)r�rr�	serializer�)r-r�s  r.�iter_headerszPropagationContext.iter_headersLsF����'��(;�(;�(=�=�=��"�"�$�.�.�0���%�w�.�.��s�AAc�n�|j�D]\}}	t|||��y#t$rY�"wxYw)zU
        Updates the PropagationContext with data from the given dictionary.
        N)r}�setattr�AttributeError)r-�
other_dictr1rs    r.r�zPropagationContext.updateVs@��%�*�*�,�J�C��
���c�5�)�-��"�
��
�s�
(�	4�4c��||_yr,)r�)r-r�s  r.�_set_custom_sampling_contextz/PropagationContext._set_custom_sampling_context`s��(?��$r0c��dj|j|j|j|j|j
�S)Nz\<PropagationContext _trace_id={} _span_id={} parent_span_id={} parent_sampled={} baggage={}>)rnr�r�r�r�r�rBs r.�__repr__zPropagationContext.__repr__es<��m�t�t��N�N��M�M��������L�L�
�	
r0c��|j�ytt|jjj	d��}|�
d|cxkrdkrytt|jjj	d��}t|j|�\}}	t|j||f��}|d
�|jjd<y#t$r)tjd|j�d|�d	��YywxYw)a
        Ensure that there is a valid sample_rand value in the baggage.

        If there is a valid sample_rand value in the baggage, 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 baggage.
        N�sample_randrr<�sample_rate��intervalz5Could not backfill sample_rand, since parent_sampled=z and sample_rate=�.�.6f)r�r�float�sentry_itemsrW�_sample_rand_ranger��_generate_sample_randr��
ValueErrorr�debug)r-r"r#�lowerr8s     r.r�z$PropagationContext._fill_sample_randns���&�<�<���!�%����)B�)B�)F�)F�}�)U�V���"�q�K�';�!�';��(<�"�%����)B�)B�)F�)F�}�)U�V��)�$�*=�*=�{�K���u�	�/��
�
��PU��W�K�7B�#�5F����!�!�-�0���		�

�L�L�G��H[�H[�G\�]#�#.�-�q�2�
�
�		�s�C�/D�Dc�f�|j�y|jjjd�S)zAConvenience method to get the sample_rand value from the baggage.Nr")r�r)rWrBs r.�_sample_randzPropagationContext._sample_rand�s*���<�<����|�|�(�(�,�,�]�;�;r0)NNNNNN)r�rgr�rgr�rgr��Optional[bool]r�zOptional[Dict[str, str]]r��Optional[Baggage]r*N)r�Dict[str, Any]r*r�)r*rQ)r*r�)r*zIterator[Tuple[str, str]])rr3r*N)r��dict[str, Any]r*N�r*N)r*rg)rLrMrN�__doc__�	__slots__r/�classmethodr�propertyrFr��setterr�r�rrrr�rr r�r0r=r0r.r�r��sv����I�%)�#'�*.�+/�?C�'+�H�!�H�!�H�(�	H�
)�H�#=�
H�%�H�
�H�B�#�,�#�	�#��#�:��#�����_�_��c��d����������
�^�^��S��T�����=��=�1��1��
/��?�'7�?�	
�?�

�#�
�-H�^<r0r�c� �eZdZdZdZdZejd�Z		dddde	de
fd	�Zed
d�					dd��Z
edd��Ze				dd��Ze				dd��Zedd��Zd d�Zd!d�Zd"de
d
e	fd�Zede	d
e	fd��Zd#d�Zd
e	fd�Zy
)$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.
    �r)�third_party_items�mutablezsentry-z^sentry-r)�Dict[str, str]r=r>c�.�||_||_||_yr,r<)r-r)r=r>s    r.r/zBaggage.__init__�s��)���!2�����r0N)r0r�r*c��i}d}d}|r�|jd�D]�}d|vr�t�5|j�}|jdd�\}}tjj|�r.t
|jd�d�}	t
|�||	<d}n||rdnd|zz
}ddd���|�t|�|d	<d}t|||�S#1swY��xYw)
zF
        freeze if incoming header already has sentry baggage
        r�T�,�=r<r5FNr")�splitr�stripr��SENTRY_PREFIX_REGEXr�r
rF)
r�r�r0r)r=r>�itemr1�val�baggage_keys
          r.r�zBaggage.from_incoming_header�s�������������S�)���d�?��0�2��:�:�<�D�#�z�z�#�q�1�H�C���2�2�8�8��=�&-�c�i�i��n�Q�.?�&@��4;�C�L��[�1�"'��)�5F�c�B�RV�-V�V�)�3�2�	*��#�*-�l�*;�L��'��G��|�%6��@�@�3�2�s�A?C�C	c�n�|j�ti�Stj|j�S)zC
        Deprecated: use populate_from_propagation_context
        )�_propagation_contextr�r)r�r�s  r.�from_optionszBaggage.from_options�s1��
�%�%�-��2�;���8�8��9S�9S�T�Tr0c��i}d}d}tj�}|j�st|�S|j}|j
|d<|j
d�r|d|d<|j
d�r|d|d<|jrH|jj|d<|jjr|jj|d<|j
d�rt|d�|d	<t|||�S)
Nr�Fr��environment�release�
public_key�org_idrTr#)rvrwr�r�rPr�rW�
parsed_dsnrPrQrF)r�rr)r=r>rrPs       r.rz)Baggage.populate_from_propagation_context�s���*,�������&�&�(�����!��<�(�(��.�.��#6�#?�#?��Z� ��;�;�}�%�*1�-�*@�L��'��;�;�y�!�&-�i�&8�L��#����)/�):�):�)E�)E�L��&�� � �'�'�)/�):�):�)A�)A��X�&��;�;�+�,�*-�g�6J�.K�*L�L��'��|�%6��@�@r0c�X�tj�}i}|j�st|�S|jxsi}|j
|d<|jd�|d<|jd�r|d|d<|jd�r|d|d<|jrH|jj|d<|jjr|jj|d<|jr!|jtvr|j|d<|j�t|j�|d	<|j �|j rd
nd|d<|j"r;|j"j$r%|j'|j"j$�t|d
��S)��
        Populate fresh baggage entry with sentry_items and make it immutable
        if this is the head SDK which originates traces.
        r�r'r"rNrOrPrQ�transactionr#�true�false�sampledF�r>)rvrwr�r�rPr�r0rWrRrPrQrr�source�LOW_QUALITY_TRANSACTION_SOURCESr#rFrX�_baggager)r�)r�rUrr)rPs     r.�populate_from_transactionz!Baggage.populate_from_transactions����&�&�(��)+�����!��<�(�(��.�.�&�B��#.�#7�#7��Z� �)4�)A�)A�#�(F��]�#��;�;�}�%�*1�-�*@�L��'��;�;�y�!�&-�i�&8�L��#����)/�):�):�)E�)E�L��&�� � �'�'�)/�):�):�)A�)A��X�&�
����"�"�*I�I�*5�*:�*:�L��'��"�"�.�*-�k�.E�.E�*F�L��'����*�0;�0C�0C�f��L��#�
���K�$8�$8�$E�$E����� 4� 4� A� A�B��|�U�3�3r0c�~�tj�}i}|j�st|�S|jxsi}|j
|d<|jd�|d<|jd�r|d|d<|jd�r|d|d<|jrH|jj|d<|jjr|jj|d<|j�jd�tvr|jr|j|d	<|j�t|j�|d
<|j �|j rdnd|d
<|j"r;|j"j$r%|j'|j"j$�t|d��S)rTr�r'r"rNrOrPrQzsentry.span.sourcerUr#rVrWrXFrY)rvrwr�r�rPr�r0rWrRrPrQ�get_attributes�LOW_QUALITY_SEGMENT_SOURCES�_name�_sample_raterFrXr\r)r�)r��segmentrr)rPs     r.�populate_from_segmentzBaggage.populate_from_segment=s����&�&�(��)+�����!��<�(�(��.�.�&�B��#*�#3�#3��Z� �)0�)=�)=�c�(B��]�#��;�;�}�%�*1�-�*@�L��'��;�;�y�!�&-�i�&8�L��#����)/�):�):�)E�)E�L��&�� � �'�'�)/�):�):�)A�)A��X�&�
�"�"�$�(�(�)=�>�.�
/��m�m�*1�-�-�L��'����+�*-�g�.B�.B�*C�L��'��?�?�&�07���f�W�L��#����� 0� 0� =� =����� 0� 0� =� =�>��|�U�3�3r0c��d|_y�NFrYrBs r.�freezezBaggage.freezens	����r0c�X�i}|jj�D]
\}}|||<�|Sr,)r)r})r-r�r1rGs    r.r�z Baggage.dynamic_sampling_contextqs4�����*�*�0�0�2�I�C���F�3�K�3��
r0�include_third_partyc�n�g}|jj�D]]\}}t�5tjt|�zdztt
|��z}|j|�ddd��_|r|j|j�dj|�S#1swY��xYw)NrCrB)
r)r}rr��
SENTRY_PREFIXr	rF�appendr=�join)r-rir}r1rHrGs      r.rzBaggage.serializeys������)�)�/�/�1�H�C��,�.��,�,�u�S�z�9�C�?�%��C��/�Q�����T�"�/�.�2�
��L�L��/�/�0��x�x����/�.�s�AB+�+B4	c�P�djd�|jd�D��S)z�Remove Sentry baggage from the given header.

        Given a Baggage header, return a new Baggage header with all Sentry baggage items removed.
        rBc3�zK�|]3}tjj|j��s|���5y�wr,)r�rFr�rE)r>rGs  r.r?z/Baggage.strip_sentry_baggage.<locals>.<genexpr>�s2����
�-�D��2�2�8�8�����F��-�s�9;)rmrD)r�s r.�strip_sentry_baggagezBaggage.strip_sentry_baggage�s+���x�x�
�"�L�L��-�
�
�	
r0c�x�tt|jjd��}|�d|cxkrdkr|Syy)z�Convenience 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���?)rr(r)rW)r-r"s  r.r0zBaggage._sample_rand�sD��"�%��):�):�)>�)>�}�)M�N���"�s�k�'?�C�'?���(@�r0c�H�d|jd���d|j�d�S)Nz
<Baggage "T)riz", mutable=�>)rr>rBs r.r zBaggage.__repr__�s,���D�N�N�t�N�D�E�[�QU�Q]�Q]�P^�^_�`�`r0)r�T)r�rgr0rgr*r�)r�zsentry_sdk.scope.Scoper*r2)rr�r*r�)rUzsentry_sdk.tracing.Transactionr*r�)rcr�r*r�r5)r*r?)F)r*�Optional[float])rLrMrNr6r7rk�re�compilerFrFrVr/r8r�rLrr]rdrgr�r�staticmethodrpr0r r=r0r.r�r��sT���A�I��M�$�"�*�*�Z�0��
"$��	�&�����	��
)-�	 A�� A�&�	 A�

� A�� A�D�U��U��A�"6�A�	�A��A�@�/4�:�/4�	�/4��/4�b�.4��.4�`���T��c���
�S�
�S�
��
��a�#�ar0r�rzsentry_sdk.client.BaseClient�urlc�V�|jd}t||�ryt||d��S)zy
    Returns True if url matches trace_propagation_targets configured in the given client. Otherwise, returns False.
    �trace_propagation_targetsFT)�substring_matching)rPrr)rrzr|s   r.�should_propagate_tracer~�s1��!'���/J� K���V�S�!���C�!:�t�T�Tr0c��i}|j�D]@\}}|jd�r|dd}|jdd�j�}|||<�B|S)z�
    Normalizes incoming data so the keys are all lowercase with dashes instead of underscores and stripped from known prefixes.
    rK�Nr6r5)r}rGr7r.)rrqr1rs    r.r�r��s`���D�#�)�)�+�
��U��>�>�'�"��a�b�'�C��k�k�#�s�#�)�)�+����S�	�,��Kr0rrrs�templatec�0������ddlm�d�����fd�}|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�l���tj��d������fd��}	tj��|_tj��d������fd��}	tj��|_tj��r|S|S#t
$rY�bwxYw#t
$rY�3wxYw)�D
        Decorator to create a span for the given function.
        c
��P�K�t�}|�/tjdt�
���
|i|���d{���St	|t
�r,t
jdtd���
|i|���d{���S�xst��}�xst�
�xsd}t�||�}�
�}|j||��5}|j�	xsi�t|�||�
||��
|i|���d{���}t|�||�|cddd�S7��7��7�!#1swYyxYw�w�NzbCannot create a child span for %s. Please start a Sentry transaction before calling this function.zBUse the @sentry_sdk.traces.trace decorator in span streaming mode.���
stacklevelr�)rtrr��get_current_spanrr-rrEr��warnings�warn�DeprecationWarning�_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_piir��resultrs�frrrtr�r�s         ������r.�
async_wrapperzDcreate_span_decorator.<locals>.span_decorator.<locals>.async_wrapper�sE�����+�-�L��#����V�*�1�-��
��/��/�/�/��,��5��
�
�X�&� ��
��/��/�/�/��2�L��2�G� �C�$:�1�$=�C��M�&�x���G�I�.�0�H��)�)���*���� � ��!1�r�2�%��(�H�m�Q��f�� !�$�1�&�1�1��&�t�X�x��H����0��0�� 2����sL�7D&�D�;D&�6D�7A
D&�2D�6D�7D�
D&�D&�D�D#�D&c
���t�}|�'tjdt�
���
|i|��St	|t
�r$t
jdtd���
|i|��S�xst��}�xst�
�xsd}t�||�}�
�}|j||��5}|j�	xsi�t|�||�
||��
|i|��}t|�||�|cddd�S#1swYyxYwr�r�r�s         ������r.�sync_wrapperzCcreate_span_decorator.<locals>.span_decorator.<locals>.sync_wrapper
s"���+�-�L��#����V�*�1�-��
�$�)�&�)�)��,��5��
�
�X�&� ��
�$�)�&�)�)��2�L��2�G� �C�$:�1�$=�C��M�&�x���G�I�.�0�H��)�)���*���� � ��!1�r�2�%��(�H�m�Q��f���D�+�F�+��&�t�X�x��H�����s�2>C:�:D�r�rr�rr*r��	functools�wraps�inspect�	signature�
__signature__r��iscoroutinefunction)r�r�r�rsrrrtr�r�s`  �����r.�span_decoratorz-create_span_decorator.<locals>.span_decorator�s����

����	�%	�%	�
�%	�N	�*1�*;�*;�A�*>�M�'�
����	�%	�%	�
�%	�N	�)0�):�):�1�)=�L�&��&�&�q�)� � ����g�	��	��Z�	��	�s#�B�%B'�	B$�#B$�'	B3�2B3�r�rr*r)�sentry_sdk.scoper�)rtrrrsr�r�r�s```` @r.�create_span_decoratorr��s���,9�b �b �H�r0�activec�����d���fd�}|S)zW
    Create a span creating decorator that can wrap both sync and async functions.
    c�d���tj��d����fd��}	tj��|_tj��d����fd��}	tj��|_tj��r|S|S#t
$rY�`wxYw#t
$rY�3wxYw)r�c��B�K�tj�}|j�r,t|j�stjdd���xst��xsd}t|����5�|i|���d{���}|cddd�S7�#1swYyxYw�w�NzSUsing span streaming API in non-span-streaming mode. Use @sentry_sdk.trace instead.r�r�r�)rrrsr��	rvrwr�r_rPr�r�r�start_streaming_span)	r�r�rr�r�r�rsr�rrs	     ����r.r�zNcreate_streaming_span_decorator.<locals>.span_decorator.<locals>.async_wrapperMs�������*�*�,�F����!�*D�V�^�^�*T��
�
�1� ���?� 6�q� 9�?�R�I�%��:�f�� !�$�1�&�1�1���	��2����s0�A2B�5B�B�B�
B�B�B�Bc�"��tj�}|j�r,t|j�stjdd���xst��xsd}t|����5�|i|��cddd�S#1swYyxYwr�r�)r�r�rr�r�rsr�rrs    ����r.r�zMcreate_streaming_span_decorator.<locals>.span_decorator.<locals>.sync_wrapperds�����*�*�,�F����!�*D�V�^�^�*T��
�
�1� ���?� 6�q� 9�?�R�I�%��:�f���$�)�&�)����s�3B�Br�r�)r�r�r�r�rsrrs`  ���r.r�z7create_streaming_span_decorator.<locals>.span_decoratorHs����

����	�	�
�	�"	�*1�*;�*;�A�*>�M�'�
����	�	*�
�	*� 	�)0�):�):�1�)=�L�&��&�&�q�)� � ����9�	��	��,�	��	�s#�B�!B#�	B �B �#	B/�.B/r�r=)rrrsr�r�s``` r.�create_streaming_span_decoratorr�?s���5 �n�r0c�N�|xstj�}|j}|S)zU
    Returns the currently active span if there is one running, otherwise `None`
    )rv�get_current_scoper�)r�r�s  r.r�r��s&��
�3�Z�1�1�3�E��:�:�L��r0�rrrsr$r�r%�tuple[float, float]c���|\}}||kstd��t|�}t|dz�}t|dz�}	|j||�}|dzS#t$r	|}Y|dzSwxYw)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,rrO�	randrange)r�r%r.r8�rng�lower_scaled�upper_scaled�sample_rand_scaleds        r.r+r+�s����L�E�5��5�=��J�K�K�
��
�C��u�y�(�)�L��u�y�(�)�L�*� �]�]�<��F���	�)�)���*�*���	�)�)�*�s�A�A'�&A'c�$�|�|�y|durd|fS|dfS)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.
    r�Trrrsr=)r�r#s  r.r*r*�s0�����!4��	�4�	��K����C��r0rZr1r2c��d}t|t�r|j|�}|St||�r	t	||�}|S|S#t
$rd}Y|SwxYw)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)rE�dictrWr��getattrr�)rZr1rs   r.�
_get_valuer��sj��

�E��&�$���
�
�3����L��6�3��
����,���L�5�L���
����L�
�s�A�A�AzUnion[str, SPANTEMPLATE]r�c��|}|tjk(rDd}|r3dD].}|j|�s�t||t�s�)||}n|rd|��}|Sd}|S|tj
k(rd|��}|S|tjk(rd|��}|S)zF
    Get the name of the span based on the template and the name.
    N)�model�
model_namezchat �chatz
invoke_agent z
execute_tool )r�AI_CHATrWrErF�AI_AGENT�AI_TOOL)r�rrr�r�r�r1s      r.r�r��s����I��<�'�'�'����.���:�:�c�?�z�&��+�s�'C�"�3�K�E��/�
(-�e�E�7�O�	���39�	���

�\�*�*�	*�#�D�6�*�	�
��
�\�)�)�	)�#�D�6�*�	��r0c��tjtjtjtj
tjtji}|j|tj�}t|�S)z>
    Get the operation of the span based on the template.
    )rr�r
�GEN_AI_CHATr��GEN_AI_INVOKE_AGENTr��GEN_AI_EXECUTE_TOOLrW�FUNCTIONrF)r��mappingrts   r.r�r��s\��
	���b�n�n����r�5�5����b�4�4�A�G�

���X�r�{�{�	+�B��r�7�Nr0r�r�ztuple[Any, ...]r4c����i�|tjtjtjfv�r�tj
tftj
tftjtftjtftjtftjtftjtftjtftjtftjtfd�
�dtddddf��fd�}t!|j#��D]�\}}|dk(rCt%|t�r3�j'tj(g�j+d	|d
���N|dk(rCt%|t�r3�j'tj(g�j+d|d
����|||���|tjk(r!|rt-||d
���tj.<tj(�vr-t-�tj(��tj(<�S)z;
    Get input attributes for the given span template.
    )
r�r��agent�
agent_name�
max_tokens�frequency_penalty�presence_penalty�temperature�top_p�top_kr1rrr*Nc�J��|�vr�|\}}|�t||�r|�|<yyyyr,)rE)r1r�	attribute�	data_typersr�s    ��r.�
_set_from_keyz,_get_input_attributes.<locals>._set_from_keys?����g�~�)0���&��I��$��E�9�)E�,1�J�y�)�*F�$�r0�prompt�user)�role�content�
system_prompt�system)r�r�)rr�r�r�r�GEN_AI_REQUEST_MODELrF�GEN_AI_AGENT_NAME�GEN_AI_REQUEST_MAX_TOKENSrO� GEN_AI_REQUEST_FREQUENCY_PENALTYr(�GEN_AI_REQUEST_PRESENCE_PENALTY�GEN_AI_REQUEST_TEMPERATURE�GEN_AI_REQUEST_TOP_P�GEN_AI_REQUEST_TOP_K�listr}rE�
setdefault�GEN_AI_REQUEST_MESSAGESrlr�GEN_AI_TOOL_INPUT)	r�r�r�r�r�r1rrsr�s	       @@r.�_get_input_attributesr��s����$&�J��L�)�)�<�+?�+?��AU�AU�V�V��3�3�S�9�#�8�8�#�>��0�0�#�6�#�5�5�s�;�#�=�=�s�C�"*�"K�"K�U�!S�!)�!I�!I�5� Q�$�?�?��G��3�3�U�;��3�3�S�9�
��	2�s�	2�5�	2�T�	2��v�|�|�~�.�J�C���h��:�e�S�#9��%�%�h�&F�&F��K�R�R�#��6����o�%�*�U�C�*@��%�%�h�&F�&F��K�R�R�%�%�8����#�u�%�/��<�'�'�'�H�1:��V�,�2
�
�8�-�-�.�
�'�'�:�5�7@��x�7�7�8�8
�
�8�3�3�4��r0c����i�dtddddf��fd�}|tjd�|tjd�|tjd	��S)
z
    Get usage attributes.
    r��keysztuple[str, ...]r*Nc�^��|D]'}t�|�}|��t|t�s�#|�|<�)yr,)r�rErO)r�r�r1rrs�usages    ��r.�_set_from_keysz-_get_usage_attributes.<locals>._set_from_keys:s2����C��u�c�*�E�� �Z��s�%;�(-�
�9�%�r0)�
prompt_tokens�input_tokens)�completion_tokens�
output_tokens)�total_tokens)rFr�GEN_AI_USAGE_INPUT_TOKENS�GEN_AI_USAGE_OUTPUT_TOKENS�GEN_AI_USAGE_TOTAL_TOKENS)r�r�rss` @r.�_get_usage_attributesr4so����J�.�#�.�->�.�4�.���*�*�)����+�+�.����*�*���
�r0r�c��i}|tjtjtjfvr�t	�5|g}t|d�}|j
|�t|d�}t|d�}|j
|�|D]}|��|jt|���!t|d�}|�#t|t�r||tj<t|d�}|�#t|t�r||tj<ddd�|tjk(r|rt|�|tj<|S#1swY�<xYw)z<
    Get output attributes for the given span template.
    r��metadataNr�r�)rr�r�r�rr�rlr�rrErFr�GEN_AI_RESPONSE_MODELr�GEN_AI_TOOL_OUTPUT)	r�r�r�rs�usage_candidatesr��meta�usage_candidater�s	         r.�_get_output_attributesr	Ps/��$&�J��L�)�)�<�+?�+?��AU�AU�V�V�
(�
*� &�x���v�w�/�E��#�#�E�*��f�j�1�D��t�W�-�E��#�#�E�*�#3��"�.��%�%�&;�O�&L�M�$4�
$�F�G�4�J��%�*�Z��*E�=G�
�8�9�9�:�#�F�L�9�J��%�*�Z��*E�=G�
�8�9�9�:�-+�2�<�'�'�'�H�2;�F�2C�
�8�.�.�/���9+�
*�s�AE	�A>E	�	Er�r�c���i}|tjk(r#tjdtj|i}n||tj
k(rtjdi}nV|tjk(rCtjdtj|i}|j}|�||tj<|jt||||��|j|xsi�y)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_agentr��execute_toolN)
rr�r�GEN_AI_OPERATION_NAMEr�r�r��GEN_AI_TOOL_NAMEr6�GEN_AI_TOOL_DESCRIPTIONr�r�r�)	r�r�r�rrr�r�r�rs�	docstrings	         r.r�r�xs���&$&�J��<�(�(�(��*�*�N��&�&��
�
�
�\�)�)�	)��*�*�F�
�
�
�\�)�)�	)��*�*�N��%�%�t�
�
�
�I�I�	�� �;D�J�x�7�7�8����+�H�h��f�M�N����Z�%�2�&r0c�D�|jt|||�xsi�y)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	)r�r�r�r�s    r.r�r��s!��	���+�H�h��G�M�2�Nr0r�r2c�t�tj�}|j}|r|jnd}|r|jjd�nd}|�$|�"||k7rt
jd|�d|�d��y|jjdd�}|r%|�|�|�|�t
jd|�d|�d��yy	)
z�
    Check if we should continue the incoming trace according to the strict_trace_continuation spec.
    https://develop.sentry.dev/sdk/telemetry/traces/#stricttracecontinuation
    NrQzKStarting a new trace because org IDs don't match (incoming baggage org_id: z, SDK org_id: �)F�strict_trace_continuationzvStarting a new trace because strict trace continuation is enabled and one org ID is missing (incoming baggage org_id: T)	rvrwrRrQr)rWrr-rP)r�rrR�
client_org_id�baggage_org_idrs      r.r�r��s���
"�
"�
$�F��"�"�J�)3�J�%�%��M�;B�W�)�)�-�-�h�7��N�	�!��&��^�+����Y�Zh�Yi�iw�yF�xG�GH�
I�	
��&,�n�n�&8�&8�#�U�'��!��&�=�+@��"�}�'@��L�L�I�JX�IY�Yg�hu�gv�vw�x�
��r0�headerszMutableMapping[str, str]�sentry_baggagec��|jtd�}tj|�}t	|�dkDrdnd}||z|z|t<y)z�Add the Sentry baggage to the headers.

    This function directly mutates the provided headers. The provided sentry_baggage
    is appended to the existing baggage. If the baggage already contains Sentry items,
    they are stripped out first.
    r�rrBN)rWr�r�rprH)rr�existing_baggage�stripped_existing_baggage�	separators     r.�add_sentry_baggage_to_headersr�sV���{�{�#6��;�� '� <� <�=M� N���4�5��9��r�I�	"�I�-��>��� r0zOptional[Attributes]z<tuple[bool, Optional[float], Optional[float], Optional[str]]c��tj�}t|j�sy|j	�}d}|j
�|j
j
�}|�t|j�}t|jjd��}|rrd||j|j|j|rt|�nid�i}|jr|j|j�|jd|�}n(|j�
|j}n|jd}t!|d��st#j$d	|�d
��yt'|�}|s#|rd}	nd
}	t#j(d	|�d|	���y|}
|j*r8|d|j*j,zz}|st#j(d	|�d��y||k}|rt#j(d|���d}nD|
|k7r!||
krt#j(d	|�d��d}nt#j(d	|�d|�d��d}||||fS)z�
    Decide whether a span should be sampled.

    Returns a tuple with:
    1. the sampling decision
    2. the effective sample rate
    3. the sample rand
    4. the reason for not sampling the span, if unsampled
    )FNNNNrU�span_context)rrr�r�r�rsrT�Tracing)rZz[Tracing] Discarding z  because of invalid sample rate.)FNNr#z"traces_sampler returned 0 or Falseztraces_sample_rate is set to 0z	 because )FrrNr#r�z because backpressure)FrrN�backpressurez[Tracing] Starting r!zA because it's not included in the random sample (sampling rate = rr#)rvrwrYrP�get_active_propagation_contextr�r0r+r��callablerWr�r�r�r�r�rrr�r(r-�monitor�downsample_factor)
rrrsr�rrr"�traces_sampler_defined�sampling_contextr#�reason�sample_rate_before_backpressurerX�outcomes
             r.�_make_sampling_decisionr+�sV���
"�
"�
$�F��v�~�~�.�&��>�>�@���K��"�"�.�)�1�1�>�>�@����+�,?�,H�,H�I��&�f�n�n�&8�&8�9I�&J�K�����/�8�8�"5�"D�"D�"5�"D�"D�2<�d�:�.�"��
���6�6��#�#�$7�$O�$O�P�6�f�n�n�%5�6�7G�H���-�-�9�-�<�<�K� �.�.�)=�>�K� ��I�>����.�t�f�4T�U�V�/���$�K��!�9�F�5�F����,�T�F�)�F�8�D�E�.�'2�#�
�~�~��q�&�.�.�:�:�:�:����L�L�0���6K�L�M�3��K�'�G�����*�4�&�1�2���
,�{�:��=�=��L�L�0���6K�L�M�$�G�
�L�L�'��v�-n�oz�n{�{|�}�
�$�G��K��g�5�5r0c���tj�}|jjd�xsijd�}|sydddddtfd�}|D]�}t|ttf�r|||�s�#y	t|t�s�6d
|vsd|vs�?d	}d	}d
|vr||d
|�}d|vr5|xsi}|dj�D]\}}	||vs
||	||�r�d}n|s��|s��y	y)z:Determine if a span fits one of the rules in ignore_spans.r\�ignore_spansF�rulerrr*c��t|t�r+t|t�rt|j	|��Sy||k(Srf)rErrFrV�	fullmatch)r.rs  r.�_matchesz!is_ignored_span.<locals>._matchesYs7���d�G�$��%��%��D�N�N�5�1�2�2���u�}�r0Trrrs)
rvrwrPrWrVrErFrr�r})
rrrsrr-r1r.�name_matches�attributes_matchr�rs
          r.�is_ignored_spanr4Qs��
�
"�
"�
$�F��N�N�&�&�~�6�<�"�A�A�.�Q�L����u��U��t�����d�S�'�N�+���d�#��
��d�
#��4��<�4�;O��L�#����~�'��V��d�;���t�#�'�-�2�
�(,�\�(:�(@�(@�(B�$�I�u� �
�2�(��z�)�4�;�,1�(��)C�� 0��/�2r0)r`r�)r{)r�r[r�r�)r�)F�manual)r�r�r�zsentry_sdk.tracing.Spanr*N)r�rr*rg)
r��>Union[sentry_sdk.tracing.Span, sentry_sdk.traces.StreamedSpan]r�rgr�r�r�r�r*N)r�r6r*N)r�rgr*z+Optional[Dict[str, Union[str, bool, None]]])rr3r*r3)
rtzOptional[Union[str, OP]]rrrgrsrZr�rr*r)NNTr,)r�zOptional[sentry_sdk.Scope]r*zOptional[Span])r�r1r#rvr*r�)r�rr*r4)i�
contextlibr�r�r�rwr�rr��collections.abcrrrrr�randomr�urllib.parser	r
r�ImportError�typingrrv�sentry_sdk.constsr
rr�sentry_sdk.utilsrrrrrrrrrrrrr�typesrrrr r!r"r#r$�sentry_sdk._typesr%rxr��base64_strippedr'rVrYr_rb�contextmanagerrFr�r�r�r�r�r�r�r�rxr�r�r~r��DEFAULTr�r�r�r(r+r*r�r�r�r�rr	r�r�r�rr+r4�sentry_sdk.tracesr`r�r{r��sentry_sdk.tracingr�r[r�r�r=r0r.�<module>rFsj�����	�	�
���3�2�2��'���
!��8�8����� ��M�M�M�,� �R�Z�Z������(�W�(�6�!;����"R�(B�R�t�R�2�*D�2��2���� %��5��5��5��5� �	5�
�5��
5��5�]�5��5�p
��
�%>�
�	�
�B������*��*�	�
��"�
�
��&TQ�
J�TQ�!�TQ�*�TQ�*�	TQ�

�TQ�n+�
J�+�	�+�\+�
J�+�	�+�\���2��B&��&�C�&�O�&�$H<�H<�V}a�}a�@	U�#A�	U��	U�PT�	U�� &*� �-1�+�3�3�	|�"�|�
�|�+�|��	|�
�|�@!�-1��@�
�@�*�@�
�@��	@�H+/��'����'1�*��*�$�*��	*�>
 �$�
 �3D�
 ��
 � �u��3��?��(*.��(��

��
'��	�	�:�5��#��9�(�9��9��9�
�	9�
�9�x�8%�(�%�48�%�BG�%��%�P)'�
�)'�(�)'��)'��	)'�

�)'��
)'�
�)'�
�)'�XO�
�O�6�O�BF�O�PU�O�	�O�!�$7�!�D�!�H�
'��9<��	��&e6�

�e6�&�e6��e6�D�	e6�P*�#�*�+A�*�d�*�\�����'���{3�����s�I!�!I0�/I0
Back to Directory File Manager