o
    ©iU  ã                   @  sˆ   d dl mZ d dlmZmZ zd dlmZ W n ey!   edƒ‚w er*d dl	m
Z
 d dlmZ d dlmZmZ dd	d	d
œddd„Zd	S )é    )Úannotations)ÚTYPE_CHECKINGÚAny)ÚOpenTelemetryMiddlewarez‘`logfire.instrument_wsgi()` requires the `opentelemetry-instrumentation-wsgi` package.
You can install this with:
    pip install 'logfire[wsgi]')ÚWSGIApplication)Úmaybe_capture_server_headers)ÚRequestHookÚResponseHookFN)Úcapture_headersÚrequest_hookÚresponse_hookÚappr   r
   Úboolr   úRequestHook | Noner   úResponseHook | NoneÚkwargsr   Úreturnc                K  s   t |ƒ t| f||dœ|¤ŽS )zŠInstrument `app` so that spans are automatically created for each request.

    See the `Logfire.instrument_wsgi` method for details.
    )r   r   )r   r   )r   r
   r   r   r   © r   úi/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/logfire/_internal/integrations/wsgi.pyÚinstrument_wsgi   s   r   )r   r   r
   r   r   r   r   r   r   r   r   r   )Ú
__future__r   Útypingr   r   Ú"opentelemetry.instrumentation.wsgir   ÚImportErrorÚRuntimeErrorÚwsgiref.typesr   Úlogfire._internal.utilsr   Úlogfire.integrations.wsgir   r	   r   r   r   r   r   Ú<module>   s"    ÿÿû