관리-도구
편집 파일: queries.cpython-38.pyc
U �Mg� � @ s� d Z ddlmZmZ ddlmZ ddlmZ ddlm Z e rlddl mZ ddlm Z ddlmZ dd lmZ d d� Zdd � Zdd� Zdd� ZdS )z, Code used for the Queries module in Sentry � )�OP�SPANDATA)�_get_safe_command)�capture_internal_exceptions)� TYPE_CHECKING)�Redis)�RedisIntegration)�Span)�Anyc C s t | ||�}tj|d�}|S )N)�op�description)�_get_db_span_descriptionr ZDB_REDIS)�integrationZ redis_command�argsr � properties� r �[/opt/hc_python/lib/python3.8/site-packages/sentry_sdk/integrations/redis/modules/queries.py�_compile_db_span_properties s �r c C sV |}t � � t||�}W 5 Q R X | jo2t|�| jk}|rR|d | jtd� � d }|S )Nz...)r r Z max_data_size�len)r �command_namer r Zdata_should_be_truncatedr r r r s �r c C sv | � tjd� |�d�}|d k r2| � tjt|�� |�d�}|d k rR| � tj|� |�d�}|d k rr| � tj|� d S )N�redis�db�host�port)�set_datar Z DB_SYSTEM�getZDB_NAME�strZSERVER_ADDRESSZSERVER_PORT)�spanZconnection_paramsr r r r r r �_set_db_data_on_span. s r c C s, zt | |jj� W n tk r& Y nX d S )N)r Zconnection_poolZconnection_kwargs�AttributeError)r Zredis_instancer r r �_set_db_data? s r N)�__doc__Zsentry_sdk.constsr r Z#sentry_sdk.integrations.redis.utilsr Zsentry_sdk.utilsr �typingr r r Zsentry_sdk.integrations.redisr Zsentry_sdk.tracingr r r r r r r r r r �<module> s