o
    È­Rhx  ã                   @   sl   d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 ee
ƒZG dd„ deƒZG dd	„ d	eƒZdd	gZd
S )z*
OpenTelemetry Base Distribution (Distro)
é    )ÚABCÚabstractmethod)Ú	getLogger)ÚBaseInstrumentor)Ú
EntryPointc                   @   s>   e Zd ZdZdZdd„ Zedd„ ƒZdd„ Zd	e	fd
d„Z
dS )Ú
BaseDistrozAn ABC for distroNc                 O   s*   | j d u rtj| g|¢R i |¤Ž| _ | j S ©N)Ú	_instanceÚobjectÚ__new__)ÚclsÚargsÚkwargs© r   úf/home/air/sanwanet/backup_V2/venv/lib/python3.10/site-packages/opentelemetry/instrumentation/distro.pyr   "   s   
zBaseDistro.__new__c                 K   s   dS )úConfigure the distributionNr   ©Úselfr   r   r   r   Ú
_configure(   s    zBaseDistro._configurec                 K   s   | j di |¤Ž dS )r   Nr   )r   r   r   r   r   Ú	configure,   s   zBaseDistro.configureÚentry_pointc                 K   s   |  ¡ }|ƒ jdi |¤Ž dS )aÛ  Takes an instrumentation entry point and activates it by instantiating
        and calling instrument() on it.
        This is called for each opentelemetry_instrumentor entry point by auto
        instrumentation.

        Distros can override this method to customize the behavior by
        inspecting each entry point and configuring them in special ways,
        passing additional arguments, load a replacement/fork instead,
        skip loading entirely, etc.
        Nr   )ÚloadÚ
instrument)r   r   r   Úinstrumentorr   r   r   Úload_instrumentor0   s   zBaseDistro.load_instrumentor)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   r   r   r   r   r   r   r   r   r   r      s    
ÿr   c                   @   s   e Zd Zdd„ ZdS )ÚDefaultDistroc                 K   s   d S r   r   r   r   r   r   r   B   s   zDefaultDistro._configureN)r   r   r   r   r   r   r   r   r   A   s    r   N)r   Úabcr   r   Úloggingr   Ú*opentelemetry.instrumentation.instrumentorr   Ú&opentelemetry.util._importlib_metadatar   r   Ú_LOGr   r   Ú__all__r   r   r   r   Ú<module>   s   $