Viewing File: /opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/__pycache__/ray.cpython-312.pyc
�
h0i� � � � d dl Z d dlZd dlZd dlZd dlmZmZ d dlmZm Z m
Z
d dlmZ d dl
mZmZmZmZmZ d dlZd dlmZ erd dlmZ d d lmZmZ d d
l
mZ d� Zd� Zd
� Z G d� de
� Zy# e$ r e d� �w xY w)� N)�OP�
SPANSTATUS)�_check_minimum_version�DidNotEnable�Integration)�TransactionSource)�event_from_exception�logger�package_version�qualname_from_function�reraisezRay not installed.)�
TYPE_CHECKING)�Callable)�Any�Optional)�ExcInfoc �t � t j � j � ry t j d� y )Nz[[Tracing] Sentry not initialized in ray cluster worker, performance data will be discarded.)�
sentry_sdk�
get_client� is_activer
�debug� � �J/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/ray.py�_check_sentry_initializedr s) � �����(�(�*��
�L�L�e�r c �x �� t j �t j �� d�fd� � } | t _ y )Nc �t �� ��� t j � � r �� g���i ���S �� ��fd�}� � |� � S |S )Nc �� �� �� t j � � d d�� fd�
� }t j |� }t |j
j
� � }|j t j dt j j d �� � |j |�� |_ �r �
|� }n �
�i � ��|� }|j ��� fd�}||_ |S )N)�_sentry_tracingc � �� t � t j | xs i t j t �� t j t j �� }t j |� 5 } �|i |��}|j t j � cd d d � S # t $ rI |j t j � t! j"