Skip to content

Commit cca3d6f

Browse files
authored
fix(openai-agents): Use name, not description in start_span (#6323)
We're using the `name` argument to `start_span` throughout the SDK. There are only two places where we still use the deprecated `description` arg instead. Fix those. This aligns these two spans with equivalent spans from other AI integrations which all use `name`.
1 parent d843efc commit cca3d6f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

sentry_sdk/integrations/openai_agents/spans/ai_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def ai_client_span(
3131

3232
span = sentry_sdk.start_span(
3333
op=OP.GEN_AI_CHAT,
34-
description=f"chat {model_name}",
34+
name=f"chat {model_name}",
3535
origin=SPAN_ORIGIN,
3636
)
3737
# TODO-anton: remove hardcoded stuff and replace something that also works for embedding and so on

sentry_sdk/integrations/openai_agents/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def _create_mcp_execute_tool_spans(
224224
if output.__class__.__name__ == "McpCall":
225225
with sentry_sdk.start_span(
226226
op=OP.GEN_AI_EXECUTE_TOOL,
227-
description=f"execute_tool {output.name}",
227+
name=f"execute_tool {output.name}",
228228
start_timestamp=span.start_timestamp,
229229
) as execute_tool_span:
230230
execute_tool_span.set_data(SPANDATA.GEN_AI_TOOL_NAME, output.name)

0 commit comments

Comments
 (0)