o
    i+                     @  s  d dl mZ d dlZd dlZd dlmZmZ d dlmZm	Z	m
Z
mZmZ d dlmZ zedZeeje< W dS  eyo   esle
d ZdZi Zd	d
 ZG dd dZG dd dZe ZejZejZejZejZejZej Z ej!Z!ej"Z"ej#Z#ej$Z$ej%Z%ej&Z&ej'Z'ej(Z(ej)Z)ej*Z*ej+Z+ej,Z,ej-Z-ej.Z.ej/Z/ej0Z0ej1Z1ej2Z2ej3Z3ej4Z4ej5Z5ej6Z6ej7Z7ej8Z8ej9Z9ej:Z:ej;Z;ej<Z<ej=Z=ej>Z>ej?Z?ej@Z@ejAZAejBZBejCZCejDZDejEZEejFZFejGZGejHZHejIZIejJZJd=ddZKdd ZLd>ddZMedd ZNG dd dZOG dd dZPG dd dZQG d d! d!ZRG d"d# d#ZSG d$d% d%ZTG d&d' d'ZUG d(d) d)ZVG d*d+ d+ZWG d,d- d-ZXG d.d/ d/ZYd?d1d2ZZd@d4d5Z[dAd7d8Z\d=d9d:Z]dAd;d<Z^Y dS Y dS w )B    )annotationsN)contextmanagernullcontext)AnyContextManagerLiteralTYPE_CHECKINGSequence	MagicMocklogfire)tracedebuginfonoticewarnwarningerrorfatalz0.0.0c                  O     d S N argskwargsr   r   Z/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/logfire_api/__init__.py	configure       r   c                   @  s   e Zd Zdd Zedd Zedd Zedd Zed	d
 Zdd Z	d1ddZ
ed2ddZed3ddZejd4ddZed2ddZejd5ddZd6dd Zed!d" Zed#d$ Zed%d& Zed'd( Zed)d* Zd7d.d/Zd0S )8LogfireSpanc                 C     t  S r   r
   selfattrr   r   r   __getattr__      zLogfireSpan.__getattr__c                 C     dS N r   r!   r   r   r   name      zLogfireSpan.namec                 C     i S r   r   r(   r   r   r   
attributes   r*   zLogfireSpan.attributesc                 C  r%   Nr   r   r(   r   r   r   events"   r*   zLogfireSpan.eventsc                 C  r%   r-   r   r(   r   r   r   links&   r*   zLogfireSpan.linksc                 C     | S r   r   r(   r   r   r   	__enter__*      zLogfireSpan.__enter__returnNonec                 O  r   r   r   r!   r   r   r   r   r   __exit__-   r   zLogfireSpan.__exit__strc                 C  r%   r&   r   r(   r   r   r   message_template/   r*   zLogfireSpan.message_templatetuple[str, ...]c                 C  r%   r-   r   r(   r   r   r   tags3   r*   zLogfireSpan.tagsnew_tagsSequence[str]c                 C  r   r   r   )r!   r;   r   r   r   r:   7   r2   c                 C  r%   r&   r   r(   r   r   r   message:   r*   zLogfireSpan.messager=   c                 C  r   r   r   )r!   r=   r   r   r   r=   >   r2   boolc                 C  r%   )NFr   r(   r   r   r   is_recordingA   r2   zLogfireSpan.is_recordingc                 C  r   r   r   r(   r   r   r   contextD   r*   zLogfireSpan.contextc                 C  r   r   r   r(   r   r   r   instrumentation_scopeH   r*   z!LogfireSpan.instrumentation_scopec                 C  r   r   r   r(   r   r   r   
start_timeL   r*   zLogfireSpan.start_timec                 C  r   r   r   r(   r   r   r   end_timeP   r*   zLogfireSpan.end_timec                 C  r   r   r   r(   r   r   r   parentT   r*   zLogfireSpan.parentkeyvaluer   c                 C  r   r   r   )r!   rE   rF   r   r   r   set_attributeX   r   zLogfireSpan.set_attributeNr3   r4   r3   r7   )r3   r9   )r;   r<   r3   r4   )r=   r7   )r3   r>   )rE   r7   rF   r   r3   r4   )__name__
__module____qualname__r#   propertyr)   r,   r.   r/   r1   r6   r8   r:   setterr=   r?   r@   rA   rB   rC   rD   rG   r   r   r   r   r      sD    










r   c                   @  s  e Zd Zdd ZddddZdedd	Zddd
dZddddZddddZddddZ	ddddZ
ddddZeZddddZddddZddddZddddZdfddZdfd d!Zddd"d#Zddd$d%Zddd&d'Zd(d) Zd*d+ Zd,d- Zdgd/d0Zddd1d2Zddd3d4Zddd5d6Zddd7d8Zddd9d:Zddd;d<Zddd=d>Z ddd?d@Z!dddAdBZ"dddCdDZ#dddEdFZ$dddGdHZ%dddIdJZ&dddKdLZ'dgdMdNZ(dgdOdPZ)dgdQdRZ*dddSdTZ+dddUdVZ,dddWdXZ-dddYdZZ.ddd[d\Z/ddd]d^Z0ddd_d`Z1dddadbZ2dcS )hLogfirec                 C  r   r   r
   r    r   r   r   r#   [   r$   zLogfire.__getattr__r3   r4   c                 O  r   r   r   r5   r   r   r   __init__^   r   zLogfire.__init__r   c                 O  r   r   )r   r5   r   r   r   span`   r$   zLogfire.spanc                 O  r   r   r   r5   r   r   r   logc   r   zLogfire.logc                 O  r   r   r   r5   r   r   r   r   e   r   zLogfire.tracec                 O  r   r   r   r5   r   r   r   r   g   r   zLogfire.debugc                 O  r   r   r   r5   r   r   r   r   i   r   zLogfire.noticec                 O  r   r   r   r5   r   r   r   r   k   r   zLogfire.infoc                 O  r   r   r   r5   r   r   r   r   m   r   zLogfire.warningc                 O  r   r   r   r5   r   r   r   r   q   r   zLogfire.errorc                 O  r   r   r   r5   r   r   r   	exceptions   r   zLogfire.exceptionc                 O  r   r   r   r5   r   r   r   r   u   r   zLogfire.fatalc                 O  r   r   r   r5   r   r   r   suppress_scopesw   r   zLogfire.suppress_scopesc                 O  r0   r   r   r5   r   r   r   	with_tagsy   r2   zLogfire.with_tagsc                 O  r0   r   r   r5   r   r   r   with_settings|   r2   zLogfire.with_settingsc                 O  r   r   r   r5   r   r   r   force_flush   r   zLogfire.force_flushc                 O  r   r   r   r5   r   r   r   log_slow_async_callbacks   r$   z Logfire.log_slow_async_callbacksc                 O  r   r   r   r5   r   r   r   install_auto_tracing   r   zLogfire.install_auto_tracingc                 O  s   dd }|S )Nc                 S  r0   r   r   )funcr   r   r   	decorator   r2   z%Logfire.instrument.<locals>.decoratorr   )r!   r   r   r\   r   r   r   
instrument   s   zLogfire.instrumentc                 O     |S r   r   r!   appr   r   r   r   r   instrument_asgi   r2   zLogfire.instrument_asgic                 O  r^   r   r   r_   r   r   r   instrument_wsgi   r2   zLogfire.instrument_wsgiContextManager[None]c                 O  r   r   rX   r5   r   r   r   instrument_fastapi   r$   zLogfire.instrument_fastapic                 O  r   r   r   r5   r   r   r   instrument_pydantic   r   zLogfire.instrument_pydanticc                 O  r   r   r   r5   r   r   r   instrument_pydantic_ai   r   zLogfire.instrument_pydantic_aic                 O  r   r   r   r5   r   r   r   instrument_pymongo   r   zLogfire.instrument_pymongoc                 O  r   r   r   r5   r   r   r   instrument_sqlalchemy   r   zLogfire.instrument_sqlalchemyc                 O  r   r   r   r5   r   r   r   instrument_sqlite3   r   zLogfire.instrument_sqlite3c                 O  r   r   r   r5   r   r   r   instrument_aws_lambda   r   zLogfire.instrument_aws_lambdac                 O  r   r   r   r5   r   r   r   instrument_redis   r   zLogfire.instrument_redisc                 O  r   r   r   r5   r   r   r   instrument_flask   r   zLogfire.instrument_flaskc                 O  r   r   r   r5   r   r   r   instrument_starlette   r   zLogfire.instrument_starlettec                 O  r   r   r   r5   r   r   r   instrument_django   r   zLogfire.instrument_djangoc                 O  r   r   r   r5   r   r   r   instrument_psycopg   r   zLogfire.instrument_psycopgc                 O  r   r   r   r5   r   r   r   instrument_requests   r   zLogfire.instrument_requestsc                 O  r   r   r   r5   r   r   r   instrument_httpx   r   zLogfire.instrument_httpxc                 O  r   r   r   r5   r   r   r   instrument_asyncpg   r   zLogfire.instrument_asyncpgc                 O  r   r   rX   r5   r   r   r   instrument_anthropic   r$   zLogfire.instrument_anthropicc                 O  r   r   rX   r5   r   r   r   instrument_openai   r$   zLogfire.instrument_openaic                 O  r   r   rX   r5   r   r   r   instrument_print   r$   zLogfire.instrument_printc                 O  r   r   r   r5   r   r   r   instrument_openai_agents   r   z Logfire.instrument_openai_agentsc                 O  r   r   r   r5   r   r   r   instrument_google_genai   r   zLogfire.instrument_google_genaic                 O  r   r   r   r5   r   r   r   instrument_litellm   r   zLogfire.instrument_litellmc                 O  r   r   r   r5   r   r   r   instrument_aiohttp_client   r   z!Logfire.instrument_aiohttp_clientc                 O  r   r   r   r5   r   r   r   instrument_aiohttp_server   r   z!Logfire.instrument_aiohttp_serverc                 O  r   r   r   r5   r   r   r   instrument_system_metrics   r   z!Logfire.instrument_system_metricsc                 O  r   r   r   r5   r   r   r   instrument_mcp   r   zLogfire.instrument_mcpc                 O  r   r   r   r5   r   r   r   shutdown   r   zLogfire.shutdownNrH   )r3   r   )r3   rO   r3   rc   )3rJ   rK   rL   r#   rP   rQ   rR   r   r   r   r   r   r   r   rS   r   rT   rU   rV   rW   rY   rZ   r]   ra   rb   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r   r   r   r   rO   Z   sb    









































rO   r3   dict[str, Any]c                   C  r+   r   r   r   r   r   r   loguru_handler   r2   r   c                 C  r0   r   r   )xr   r   r   no_auto_trace   r2   r   r4   c                  O  r   r   r   r   r   r   r   add_non_user_code_prefix  r   r   c                   c  s    d V  d S r   r   r   r   r   r   suppress_instrumentation  s   
r   c                   @     e Zd ZdddZdS )ConsoleOptionsr3   r4   c                 O  r   r   r   r5   r   r   r   rP   	  r   zConsoleOptions.__init__NrH   rJ   rK   rL   rP   r   r   r   r   r         r   c                   @  r   )SamplingOptionsr3   r4   c                 O  r   r   r   r5   r   r   r   rP     r   zSamplingOptions.__init__NrH   r   r   r   r   r   r     r   r   c                   @  r   )
CodeSourcer3   r4   c                 O  r   r   r   r5   r   r   r   rP     r   zCodeSource.__init__NrH   r   r   r   r   r   r     r   r   c                   @  r   )ScrubbingOptionsr3   r4   c                 O  r   r   r   r5   r   r   r   rP     r   zScrubbingOptions.__init__NrH   r   r   r   r   r   r     r   r   c                   @  r   )AdvancedOptionsr3   r4   c                 O  r   r   r   r5   r   r   r   rP     r   zAdvancedOptions.__init__NrH   r   r   r   r   r   r     r   r   c                   @  r   )MetricsOptionsr3   r4   c                 O  r   r   r   r5   r   r   r   rP     r   zMetricsOptions.__init__NrH   r   r   r   r   r   r     r   r   c                   @  r   )PydanticPluginr3   r4   c                 O  r   r   r   r5   r   r   r   rP     r   zPydanticPlugin.__init__NrH   r   r   r   r   r   r     r   r   c                   @  r   )
ScrubMatchr3   r4   c                 O  r   r   r   r5   r   r   r   rP     r   zScrubMatch.__init__NrH   r   r   r   r   r   r     r   r   c                   @  r   )AutoTraceModuler3   r4   c                 O  r   r   r   r5   r   r   r   rP   !  r   zAutoTraceModule.__init__NrH   r   r   r   r   r   r      r   r   c                   @  r   )StructlogProcessorr3   r4   c                 O  r   r   r   r5   r   r   r   rP   $  r   zStructlogProcessor.__init__NrH   r   r   r   r   r   r   #  r   r   c                   @  r   )LogfireLoggingHandlerr3   r4   c                 O  r   r   r   r5   r   r   r   rP   '  r   zLogfireLoggingHandler.__init__NrH   r   r   r   r   r   r   &  r   r   r7   c                   C  r%   )z2Show versions of logfire, OS and related packages.z.logfire_info() is not implement by logfire-apir   r   r   r   r   logfire_info)  r*   r   dict[str, str]c                  O  r+   r   r   r   r   r   r   get_baggage-  r2   r   rc   c                  O  r   r   rX   r   r   r   r   set_baggage0  r$   r   c                  O  r+   r   r   r   r   r   r   get_context3  r2   r   c                  O  r   r   rX   r   r   r   r   attach_context6  r$   r   )r3   r   rH   rI   )r3   r   r~   )_
__future__r   	importlibsys
contextlibr   r   typingr   r   r   r   r	   unittest.mockr   import_modulelogfire_modulemodulesrJ   ImportError	LevelNameVERSIONMETRICS_PREFERRED_TEMPORALITYr   r   rO   DEFAULT_LOGFIRE_INSTANCErQ   rR   r   r   r   r   r   r   r   rS   r   rU   rV   rW   rY   rZ   r]   ra   rb   re   rf   rd   rt   rv   rs   rw   rx   rr   ru   instrument_celeryrq   rp   ro   rn   rl   rm   ry   rz   rh   ri   rj   rk   rg   instrument_mysqlr{   r|   r}   rT   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>   s    
Dp






  