관리-도구
편집 파일: client.cpython-38.pyc
U �Mg� � @ s� d dl mZmZmZmZ d dlmZmZmZm Z m Z d dlmZ d dl Z d dlmZ d dlmZ G dd� d�ZG d d � d ee�ZG dd� dee�ZdS ) � )�Callable�Union� AsyncIterable�Any)�UnaryUnaryClientInterceptor�UnaryStreamClientInterceptor�ClientCallDetails�UnaryUnaryCall�UnaryStreamCall)�MessageN)�OP)�SPAN_ORIGINc @ s e Zd Zeeed�dd��ZdS )�ClientInterceptor)�client_call_details�returnc C sV | j rt| j �ng }t�� �� D ]\}}|�||f� q t| j| j|| j | j d�} | S )N)�method�timeout�metadata�credentials�wait_for_ready)r �list� sentry_sdkZget_current_scopeZiter_trace_propagation_headers�appendr r r r r )r r �key�value� r �U/opt/hc_python/lib/python3.8/site-packages/sentry_sdk/integrations/grpc/aio/client.py�/_update_client_call_details_metadata_from_scope s � ��zAClientInterceptor._update_client_call_details_metadata_from_scopeN)�__name__� __module__�__qualname__�staticmethodr r r r r r r s �r c @ s4 e Zd Zeeegef eeeeef d�dd�ZdS )�!SentryUnaryUnaryClientInterceptor��continuationr �requestr c � s� |j }tjtjd|�� td��`}|�dd� |�d|� | �|�}|||�I d H }|� � I d H }|�d|j � |W 5 Q R � S Q R X d S )Nzunary unary call to %s��op�name�origin�typezunary unaryr �code)r r � start_spanr �GRPC_CLIENT�decoder �set_datar r+ r( )�selfr$ r r% r �span�response�status_coder r r �intercept_unary_unary+ s ��z7SentryUnaryUnaryClientInterceptor.intercept_unary_unaryN) r r r r r r r r r4 r r r r r"