@@ -60,7 +60,7 @@ def set_request_id_to_context_var(self, request):
6060 request_context .set (ctx )
6161
6262 def set_run_context_to_context_var (self , run_context ):
63- agent_id = ""
63+ agent_id , agent_name = "" , ""
6464 agent_obj = run_context .get_agent_id_object ()
6565 if agent_obj :
6666 agent_name = getattr (agent_obj , "name" , "" )
@@ -72,6 +72,7 @@ def set_run_context_to_context_var(self, run_context):
7272 "azure.ai.agentshosting.conversation_id" : run_context .conversation_id or "" ,
7373 "azure.ai.agentshosting.streaming" : str (run_context .stream or False ),
7474 "gen_ai.agent.id" : agent_id ,
75+ "gen_ai.agent.name" : agent_name ,
7576 "gen_ai.provider.name" : "AzureAI Hosted Agents" ,
7677 "gen_ai.response.id" : run_context .response_id or "" ,
7778 }
@@ -87,7 +88,7 @@ async def runs_endpoint(request):
8788 context = request .state .agent_run_context
8889 ctx = request_context .get ()
8990 with self .tracer .start_as_current_span (
90- name = f"ContainerAgentsAdapter -{ context .response_id } " ,
91+ name = f"HostedAgents -{ context .response_id } " ,
9192 attributes = ctx ,
9293 kind = trace .SpanKind .SERVER ,
9394 ):
0 commit comments