SԹFh7 d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dl m
Z
erd dlmZmZ d dl
mZmZmZmZ d gZ G d
d e
Zd Zd Zd
ZdS ) )absolute_importN)Hub)MYPY)OP)Integration)
AddressFamily
SocketKind)TupleOptionalUnionListSocketIntegrationc ( e Zd ZdZed ZdS )r socketc > t t dS )zs
patches two of the most used functions of socket: create_connection and getaddrinfo(dns resolver)
N)_patch_create_connection_patch_getaddrinfo p/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/sentry_sdk/integrations/socket.py
setup_oncezSocketIntegration.setup_once s" !"""r N)__name__
__module____qualname__
identifierstaticmethodr r r r r r s2 J \ r c n | } n# t t f$ r Y nw xY w| d|}|S )N:)decodeUnicodeDecodeErrorAttributeError)hostportdescriptions r _get_span_descriptionr% sS
{{}}/
"TT44(Ks ++c \ t j t j d ffd } | t _ d S )Nc t j }| t | || S | t
j t | d | d 5 }| d| | d| | d| | || cd d d S # 1 swxY w Y d S )N)addresstimeoutsource_addressr opr$ r( r) r* ) r currentget_integrationr
start_spanr SOCKET_CONNECTIONr% set_data)r( r) r* hubspanreal_create_connections r create_connectionz3_patch_create_connection.