Skip to content

Commit b219cd8

Browse files
committed
fix(openai-agents): refactor span data assignment to use set_data_normalized for tool execution
1 parent 99b1ddb commit b219cd8

File tree

1 file changed

+4
-2
lines changed
  • sentry_sdk/integrations/openai_agents

1 file changed

+4
-2
lines changed

sentry_sdk/integrations/openai_agents/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ def _create_mcp_execute_tool_spans(span, result):
167167
description=f"execute_tool {output.name}",
168168
start_timestamp=span.start_timestamp,
169169
) as execute_tool_span:
170-
execute_tool_span.set_tag(SPANDATA.GEN_AI_TOOL_TYPE, "mcp")
171-
execute_tool_span.set_tag(SPANDATA.GEN_AI_TOOL_NAME, output.name)
170+
set_data_normalized(execute_tool_span, SPANDATA.GEN_AI_TOOL_TYPE, "mcp")
171+
set_data_normalized(
172+
execute_tool_span, SPANDATA.GEN_AI_TOOL_NAME, output.name
173+
)
172174
if should_send_default_pii():
173175
execute_tool_span.set_data(
174176
SPANDATA.GEN_AI_TOOL_INPUT, output.arguments

0 commit comments

Comments
 (0)