관리-도구
편집 파일: aiohttp.cpython-311.pyc
� �܋f!- � � � d dl Z d dlZd dlmZ d dlmZ d dlmZmZ d dl m Z d dlmZm Z d dlmZ d dlmZ d d lmZmZ d d lmZmZmZ d dlmZ d dlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% d dl&Z&d d l'm(Z) d dl'm*Z*m+Z+ d dl,m-Z-m.Z.m/Z/ n# e0$ r e d� � �w xY wd dl1m2Z2 e2rJd dl3m4Z4 d dl5m6Z6 d dl'm7Z7m8Z8 d dl9m:Z: d dl;m<Z< d dl;m=Z= d dl;m>Z> d dl;m?Z? d dl;m@Z@ d dl;mAZA d dlmBZB d dl1mCZC dZD G d� d e� � ZEd!� ZFd"� ZGd#� ZHd$ZId%� ZJdS )&� N)�continue_trace)�reraise)�OP�SPANDATA)�Hub)�Integration�DidNotEnable)� ignore_logger)�auto_session_tracking)�_filter_headers�request_body_within_bounds)�BAGGAGE_HEADER_NAME�SOURCE_FOR_STYLE�TRANSACTION_SOURCE_ROUTE)�should_propagate_trace) �capture_internal_exceptions�event_from_exception�logger� parse_url� parse_version�transaction_from_function�HAS_REAL_CONTEXTVARS�CONTEXTVARS_ERROR_MESSAGE�SENSITIVE_DATA_SUBSTITUTE�AnnotatedValue)�__version__)� ClientSession�TraceConfig)�Application� HTTPException� UrlDispatcherzAIOHTTP not installed)� TYPE_CHECKING)�Request)�AbstractMatchInfo)�TraceRequestStartParams�TraceRequestEndParams)�SimpleNamespace)�Any)�Dict)�Optional)�Tuple)�Callable)�Union)�ExcInfo)�EventProcessor)�handler_name�method_and_path_patternc �0 � e Zd ZdZdd�Zed� � � ZdS )�AioHttpIntegration�aiohttpr0 c �\ � |t vrt d|�dt �d�� � �|| _ d S )Nz%Invalid value for transaction_style: z (must be in �))�TRANSACTION_STYLE_VALUES� ValueError�transaction_style)�selfr9 s �V/opt/cloudlinux/venv/lib64/python3.11/site-packages/sentry_sdk/integrations/aiohttp.py�__init__zAioHttpIntegration.__init__C sJ � ��$<�<�<��*�$�$�$�&>�&>�&>�@�� � � "3����� c � ���� t t � � } | �'t d� t � � � � �| dk rt d� � �t st dt z � � �t d� � t j ��fd�}|t _ t j ��fd�}|t _ t j ��fd�}|t _ d S ) NzUnparsable AIOHTTP version: {})� � zAIOHTTP 3.4 or newer required.zSThe aiohttp integration for Sentry requires Python 3.7+ or aiocontextvars package.zaiohttp.serverc � �@ �K � t j }|� t � � � � | |g|�R i |��� d {V ��S t j |� � }t |� � 5 }t |d�� � 5 |� � � 5 }|� � � |� t |� � � � d d d � � n# 1 swxY w Y t |j t j dt �� � }|� |d|i�� � 5 � | |� � � d {V ��}ny# t"