
    kKj                         d Z ddlmZ ddlmZ ddlmZmZmZm	Z	 ddl
mZ ddlmZ e	 	 	 	 dded	ed
ededz  dedz  dedz  dedz  deeddf   fd       ZdgZy)zClient-side telemetry helpers.    )	Generator)contextmanager)SpanSpanKindStatus
StatusCode)	ToolError)
get_tracerNnamemethodcomponent_key
session_idresource_uri	tool_nameprompt_namereturnc           
   #   X  K   t               }|j                  | t        j                        5 }|j	                         r2||d}	|||	d<   |r||	d<   |||	d<   |||	d<   |j                  |	       	 | 	 ddd       y# t        $ r}
|j	                         r|t        |
t              rdnt        |
      j                  }|j                  d	|       |j                  |
       |j                  t        t        j                   t#        |
                    d}
~
ww xY w# 1 sw Y   yxY ww)
zCreate a CLIENT span with standard MCP attributes.

    Automatically records any exception on the span and sets error status.
    )kind)zmcp.method.namezfastmcp.component.keyNzmcp.session.idzmcp.resource.urizgen_ai.tool.namezgen_ai.prompt.name
tool_errorz
error.type)r
   start_as_current_spanr   CLIENTis_recordingset_attributes	Exception
isinstance
_ToolErrortype__qualname__set_attributerecord_exception
set_statusr   r   ERRORstr)r   r   r   r   r   r   r   tracerspanattrse
error_types               i/Users/ahmed/devFolder/Ultron/claude-voice/.venv/lib/python3.12/site-packages/fastmcp/client/telemetry.pyclient_spanr*      s+     \F		%	%d	%	AT $*)6	%E %*4&',8()$,5()&.9*+&
	J% 
B	A&  	  "$.q*$=L47CWCW  ""<<%%a(z'7'7Q @A	' 
B	As<   ,D*AD2B 7	D* 	D	BDDDD'#D*r*   )NNNN)__doc__collections.abcr   
contextlibr   opentelemetry.tracer   r   r   r   fastmcp.exceptionsr	   r   fastmcp.telemetryr
   r#   r*   __all__     r)   <module>r4      s    $ % % B B 6 ( 
 "# ")
)) ) d
	)
 *) Tz) t) tT4 ) )X /r3   