o
    i	                     @   s   d dl mZmZmZmZ d dlmZ erddlmZ dd Z	edee
 dee
 d	ee
 d
ee ded f
ddZddddddee
 dee
 d	ee
 deee
ee
eeef f  ded f
ddZdS )    )OptionalUnionMappingTYPE_CHECKING)	lru_cache   OpenTelemetryTracerc                  C   s(   z	ddl m}  | W S  ty   Y d S w )Nr   r   )tracing.opentelemetryr	   ImportErrorr    r   Q/home/app/Keep/.python/lib/python3.10/site-packages/azure/core/instrumentation.py_get_tracer_impl   s   r   library_namelibrary_version
schema_urlattributes_keyreturnr	   c                 C   s.   t  }|r|rt|nd }|| |||dS d S )Nr   r   r   
attributes)r   dict)r   r   r   r   Ztracer_implr   r   r   r   _get_tracer_cached   s   r   Nr   r   c                 C   s"   |rt | nd}t| |||S )a`  Get the OpenTelemetry tracer instance if available.

    If OpenTelemetry is not available, this method will return None. This method caches
    the tracer instance for each unique set of parameters.

    :keyword library_name: The name of the library to use in the tracer.
    :paramtype library_name: str
    :keyword library_version: The version of the library to use in the tracer.
    :paramtype library_version: str
    :keyword schema_url: Specifies the Schema URL of the emitted spans. Defaults to
        "https://opentelemetry.io/schemas/1.23.1".
    :paramtype schema_url: str
    :keyword attributes: Attributes to add to the emitted spans.
    :paramtype attributes: Mapping[str, Union[str, bool, int, float]]
    :return: The OpenTelemetry tracer instance if available.
    :rtype: Optional[~azure.core.tracing.opentelemetry.OpenTelemetryTracer]
    N)	frozensetitemsr   )r   r   r   r   r   r   r   r   
get_tracer*   s   r   )typingr   r   r   r   	functoolsr   r
   r	   r   strr   r   boolintfloatr   r   r   r   r   <module>   s@   
