o
    i                     @  s   d dl 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
y+   edw d dlmZ d dlmZmZmZ d	d	d	d
dddZd	S )    )annotations)Any)Flask)warn_at_user_stacklevel)FlaskInstrumentorz`logfire.instrument_flask()` requires the `opentelemetry-instrumentation-flask` package.
You can install this with:
    pip install 'logfire[flask]')maybe_capture_server_headers)CommenterOptionsRequestHookResponseHookN)excluded_urlsrequest_hookresponse_hookappr   capture_headersboolenable_commentercommenter_optionsCommenterOptions | Noner   
str | Noner   RequestHook | Noner   ResponseHook | Nonekwargsr   c                K  sN   t | d|v rtdt |p|dd}t j| f|||||d| dS )zInstrument `app` so that spans are automatically created for each request.

    See the `Logfire.instrument_flask` method for details.
    exclude_urlsz5exclude_urls is deprecated; use excluded_urls insteadN)r   r   r   r   r   )r   r   DeprecationWarningpopr   instrument_app)r   r   r   r   r   r   r   r    r   j/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/logfire/_internal/integrations/flask.pyinstrument_flask   s   

r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )
__future__r   typingr   	flask.appr   logfire._internal.stack_infor   #opentelemetry.instrumentation.flaskr   ImportErrorRuntimeErrorlogfire._internal.utilsr   logfire.integrations.flaskr   r	   r
   r   r   r   r   r   <module>   s"    	