o
    i                     @  s   d dl mZ d dlmZmZ d dlmZ d dlmZ d dl	m
Z
 zd dlmZ W n ey3   edw edd	d
Zd
ddddZd
S )    )annotations)AnyTypeVar)MySQLConnectionAbstract)PooledMySQLConnection)TracerProvider)MySQLInstrumentorz`logfire.instrument_mysql()` requires the `opentelemetry-instrumentation-mysql` package.
You can install this with:
    pip install 'logfire[mysql]'MySQLConnectionz/PooledMySQLConnection | MySQLConnectionAbstractN)connr
   tracer_providerr   kwargsr   returnc                 K  s2   | durt  j| |dS t  jdi |d|iS )zInstrument the `mysql` module or a specific MySQL connection so that spans are automatically created for each operation.

    See the `Logfire.instrument_mysql` method for details.
    N)r   r    )r   instrument_connection
instrument)r
   r   r   r   r   j/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/logfire/_internal/integrations/mysql.pyinstrument_mysql   s   
r   )r
   r	   r   r   r   r   r   r	   )
__future__r   typingr   r   mysql.connector.abstractsr   mysql.connector.poolingr   opentelemetry.tracer   #opentelemetry.instrumentation.mysqlr   ImportErrorRuntimeErrorr	   r   r   r   r   r   <module>   s    