Skip to content

Commit 9247ed3

Browse files
author
Liudmila Molkova
authored
fix change_context usages (#41361)
1 parent 12ecdd0 commit 9247ed3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sdk/ai/azure-ai-agents/azure/ai/agents/telemetry/_ai_agents_instrumentor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ def trace_handle_submit_tool_outputs(self, function, *args, **kwargs):
11971197
if span is None:
11981198
return function(*args, **kwargs)
11991199

1200-
with span.change_context(span.span_instance):
1200+
with span.change_context(span):
12011201
try:
12021202
result = function(*args, **kwargs)
12031203
except Exception as exc:
@@ -1215,7 +1215,7 @@ async def trace_handle_submit_tool_outputs_async(self, function, *args, **kwargs
12151215
if span is None:
12161216
return await function(*args, **kwargs)
12171217

1218-
with span.change_context(span.span_instance):
1218+
with span.change_context(span):
12191219
try:
12201220
result = await function(*args, **kwargs)
12211221
except Exception as exc:
@@ -1261,7 +1261,7 @@ def trace_create_stream(self, function, *args, **kwargs):
12611261
if span is None:
12621262
return function(*args, **kwargs)
12631263

1264-
with span.change_context(span.span_instance):
1264+
with span.change_context(span):
12651265
try:
12661266
kwargs["event_handler"] = self.wrap_handler(event_handler, span)
12671267
result = function(*args, **kwargs)
@@ -1310,7 +1310,7 @@ async def trace_create_stream_async(self, function, *args, **kwargs):
13101310

13111311
# TODO: how to keep span active in the current context without existing?
13121312
# TODO: dummy span for none
1313-
with span.change_context(span.span_instance):
1313+
with span.change_context(span):
13141314
try:
13151315
kwargs["event_handler"] = self.wrap_async_handler(event_handler, span)
13161316
result = await function(*args, **kwargs)

0 commit comments

Comments
 (0)