Skip to content

Commit 174196c

Browse files
committed
minor update on tracing
1 parent cd6f7ea commit 174196c

File tree

1 file changed

+3
-2
lines changed
  • sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/server

1 file changed

+3
-2
lines changed

sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/server/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)