From b72ee0927db1067a6ca151a7bcb9e79a69db8dd2 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Wed, 29 Jul 2026 14:34:08 +0200 Subject: [PATCH] ref(core)!: Rename `gen_ai.tool.input` to `gen_ai.tool.call.arguments` Emit the `gen_ai.tool.call.arguments` attribute from `@sentry/conventions` instead of the deprecated `gen_ai.tool.input` alias across all AI integrations (LangChain, LangGraph, Vercel AI). Co-Authored-By: Claude Opus 4.8 (1M context) --- MIGRATION.md | 1 + .../suites/tracing/vercelai/span-streaming-v4/test.ts | 4 ++-- .../suites/tracing/vercelai/span-streaming-v6/test.ts | 4 ++-- .../node-integration-tests/suites/tracing/vercelai/test.ts | 4 ++-- .../node-integration-tests/suites/tracing/vercelai/v5/test.ts | 4 ++-- .../suites/tracing/vercelai/v6_v7/test.ts | 4 ++-- packages/server-utils/src/ai/langchain/index.ts | 4 ++-- packages/server-utils/src/ai/langgraph/utils.ts | 4 ++-- packages/server-utils/src/ai/vercel-ai/index.ts | 4 ++-- .../server-utils/src/vercel-ai/vercel-ai-dc-subscriber.ts | 4 ++-- 10 files changed, 19 insertions(+), 18 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index efbeec6c97ea..1f1a7a2422fc 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -263,6 +263,7 @@ Affected SDKs: All SDKs. - The gen_ai cache token attributes `gen_ai.usage.cache_creation_input_tokens` and `gen_ai.usage.cache_read_input_tokens` were renamed to `gen_ai.usage.cache_creation.input_tokens` and `gen_ai.usage.cache_read.input_tokens`. - The `gen_ai.system` span attribute was renamed to `gen_ai.provider.name` across all AI integrations. - The `gen_ai.request.available_tools` span attribute was renamed to `gen_ai.tool.definitions` across all AI integrations. +- The `gen_ai.tool.input` span attribute was renamed to `gen_ai.tool.call.arguments` across all AI integrations. - Span attributes now use the shared `@sentry/conventions` package under the hood. If you reference these attributes in custom instrumentation, `beforeSendSpan`, dashboards, or alerts, update them to the new names. diff --git a/dev-packages/node-integration-tests/suites/tracing/vercelai/span-streaming-v4/test.ts b/dev-packages/node-integration-tests/suites/tracing/vercelai/span-streaming-v4/test.ts index 8c0d21b8692f..17667995f7db 100644 --- a/dev-packages/node-integration-tests/suites/tracing/vercelai/span-streaming-v4/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/vercelai/span-streaming-v4/test.ts @@ -6,9 +6,9 @@ import { GEN_AI_OUTPUT_MESSAGES, GEN_AI_REQUEST_MODEL, GEN_AI_RESPONSE_MODEL, + GEN_AI_TOOL_CALL_ARGUMENTS, GEN_AI_TOOL_DEFINITIONS, GEN_AI_TOOL_DESCRIPTION, - GEN_AI_TOOL_INPUT, GEN_AI_TOOL_NAME, GEN_AI_TOOL_OUTPUT, GEN_AI_TOOL_TYPE, @@ -233,7 +233,7 @@ describe('Vercel AI integration (streaming v4)', () => { attributes: expect.objectContaining({ [GEN_AI_TOOL_CALL_ID_ATTRIBUTE]: attr('call-1'), [GEN_AI_TOOL_DESCRIPTION]: attr('Get the current weather for a location'), - [GEN_AI_TOOL_INPUT]: expect.objectContaining({ value: expect.any(String) }), + [GEN_AI_TOOL_CALL_ARGUMENTS]: expect.objectContaining({ value: expect.any(String) }), [GEN_AI_TOOL_NAME]: attr('getWeather'), [GEN_AI_TOOL_OUTPUT]: expect.objectContaining({ value: expect.any(String) }), [GEN_AI_TOOL_TYPE]: attr('function'), diff --git a/dev-packages/node-integration-tests/suites/tracing/vercelai/span-streaming-v6/test.ts b/dev-packages/node-integration-tests/suites/tracing/vercelai/span-streaming-v6/test.ts index 4f9fb903c3a0..69daf114d787 100644 --- a/dev-packages/node-integration-tests/suites/tracing/vercelai/span-streaming-v6/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/vercelai/span-streaming-v6/test.ts @@ -6,9 +6,9 @@ import { GEN_AI_OUTPUT_MESSAGES, GEN_AI_REQUEST_MODEL, GEN_AI_RESPONSE_MODEL, + GEN_AI_TOOL_CALL_ARGUMENTS, GEN_AI_TOOL_DEFINITIONS, GEN_AI_TOOL_DESCRIPTION, - GEN_AI_TOOL_INPUT, GEN_AI_TOOL_NAME, GEN_AI_TOOL_OUTPUT, GEN_AI_TOOL_TYPE, @@ -227,7 +227,7 @@ describe('Vercel AI integration (streaming, v6)', () => { attributes: expect.objectContaining({ [GEN_AI_TOOL_CALL_ID_ATTRIBUTE]: attr('call-1'), [GEN_AI_TOOL_DESCRIPTION]: attr('Get the current weather for a location'), - [GEN_AI_TOOL_INPUT]: expect.objectContaining({ value: expect.any(String) }), + [GEN_AI_TOOL_CALL_ARGUMENTS]: expect.objectContaining({ value: expect.any(String) }), [GEN_AI_TOOL_NAME]: attr('getWeather'), [GEN_AI_TOOL_OUTPUT]: expect.objectContaining({ value: expect.any(String) }), [GEN_AI_TOOL_TYPE]: attr('function'), diff --git a/dev-packages/node-integration-tests/suites/tracing/vercelai/test.ts b/dev-packages/node-integration-tests/suites/tracing/vercelai/test.ts index c93015784926..8d445b9ba781 100644 --- a/dev-packages/node-integration-tests/suites/tracing/vercelai/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/vercelai/test.ts @@ -9,9 +9,9 @@ import { GEN_AI_REQUEST_MODEL, GEN_AI_RESPONSE_MODEL, GEN_AI_SYSTEM_INSTRUCTIONS, + GEN_AI_TOOL_CALL_ARGUMENTS, GEN_AI_TOOL_DEFINITIONS, GEN_AI_TOOL_DESCRIPTION, - GEN_AI_TOOL_INPUT, GEN_AI_TOOL_NAME, GEN_AI_TOOL_OUTPUT, GEN_AI_TOOL_TYPE, @@ -241,7 +241,7 @@ describe('Vercel AI integration (v4)', () => { expect(toolExecutionSpan!.attributes[GEN_AI_TOOL_DESCRIPTION].value).toBe( 'Get the current weather for a location', ); - expect(toolExecutionSpan!.attributes[GEN_AI_TOOL_INPUT]).toBeDefined(); + expect(toolExecutionSpan!.attributes[GEN_AI_TOOL_CALL_ARGUMENTS]).toBeDefined(); expect(toolExecutionSpan!.attributes[GEN_AI_TOOL_OUTPUT]).toBeDefined(); }, }) diff --git a/dev-packages/node-integration-tests/suites/tracing/vercelai/v5/test.ts b/dev-packages/node-integration-tests/suites/tracing/vercelai/v5/test.ts index 36a2f7da12c5..1e063c674914 100644 --- a/dev-packages/node-integration-tests/suites/tracing/vercelai/v5/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/vercelai/v5/test.ts @@ -6,9 +6,9 @@ import { GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MODEL, GEN_AI_RESPONSE_MODEL, + GEN_AI_TOOL_CALL_ARGUMENTS, GEN_AI_TOOL_DEFINITIONS, GEN_AI_TOOL_DESCRIPTION, - GEN_AI_TOOL_INPUT, GEN_AI_TOOL_NAME, GEN_AI_TOOL_OUTPUT, GEN_AI_TOOL_TYPE, @@ -247,7 +247,7 @@ describe('Vercel AI integration (v5)', () => { expect(toolExecutionSpan!.attributes[GEN_AI_TOOL_DESCRIPTION].value).toBe( 'Get the current weather for a location', ); - expect(toolExecutionSpan!.attributes[GEN_AI_TOOL_INPUT]).toBeDefined(); + expect(toolExecutionSpan!.attributes[GEN_AI_TOOL_CALL_ARGUMENTS]).toBeDefined(); expect(toolExecutionSpan!.attributes[GEN_AI_TOOL_OUTPUT]).toBeDefined(); }, }) diff --git a/dev-packages/node-integration-tests/suites/tracing/vercelai/v6_v7/test.ts b/dev-packages/node-integration-tests/suites/tracing/vercelai/v6_v7/test.ts index c48783c19eb0..f06e432e5b29 100644 --- a/dev-packages/node-integration-tests/suites/tracing/vercelai/v6_v7/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/vercelai/v6_v7/test.ts @@ -10,9 +10,9 @@ import { GEN_AI_RESPONSE_FINISH_REASONS, GEN_AI_RESPONSE_MODEL, GEN_AI_SYSTEM_INSTRUCTIONS, + GEN_AI_TOOL_CALL_ARGUMENTS, GEN_AI_TOOL_DEFINITIONS, GEN_AI_TOOL_DESCRIPTION, - GEN_AI_TOOL_INPUT, GEN_AI_TOOL_NAME, GEN_AI_TOOL_OUTPUT, GEN_AI_TOOL_TYPE, @@ -150,7 +150,7 @@ describe.each(matrix)('Vercel AI integration (version %s)', (version, vercelAiVe expect(toolExecutionSpan.attributes[GEN_AI_TOOL_DESCRIPTION]?.value).toBe( 'Get the current weather for a location', ); - expect(toolExecutionSpan.attributes[GEN_AI_TOOL_INPUT]).toBeDefined(); + expect(toolExecutionSpan.attributes[GEN_AI_TOOL_CALL_ARGUMENTS]).toBeDefined(); expect(toolExecutionSpan.attributes[GEN_AI_TOOL_OUTPUT]).toBeDefined(); }, }) diff --git a/packages/server-utils/src/ai/langchain/index.ts b/packages/server-utils/src/ai/langchain/index.ts index 0ded43a6d291..4d441ccd8c68 100644 --- a/packages/server-utils/src/ai/langchain/index.ts +++ b/packages/server-utils/src/ai/langchain/index.ts @@ -11,8 +11,8 @@ import type { Span, SpanAttributeValue } from '@sentry/core'; import { GEN_AI_OPERATION_NAME, GEN_AI_REQUEST_MODEL, + GEN_AI_TOOL_CALL_ARGUMENTS, GEN_AI_TOOL_DEFINITIONS, - GEN_AI_TOOL_INPUT, GEN_AI_TOOL_NAME, GEN_AI_TOOL_OUTPUT, } from '@sentry/conventions/attributes'; @@ -302,7 +302,7 @@ export function createLangChainCallbackHandler(options: LangChainOptions = {}): }; if (recordInputs) { - attributes[GEN_AI_TOOL_INPUT] = input; + attributes[GEN_AI_TOOL_CALL_ARGUMENTS] = input; } startSpanManual( diff --git a/packages/server-utils/src/ai/langgraph/utils.ts b/packages/server-utils/src/ai/langgraph/utils.ts index 07d1d0d0c2ba..3b1bf402a614 100644 --- a/packages/server-utils/src/ai/langgraph/utils.ts +++ b/packages/server-utils/src/ai/langgraph/utils.ts @@ -14,8 +14,8 @@ import { GEN_AI_RESPONSE_MODEL, GEN_AI_RESPONSE_TEXT, GEN_AI_RESPONSE_TOOL_CALLS, + GEN_AI_TOOL_CALL_ARGUMENTS, GEN_AI_TOOL_DESCRIPTION, - GEN_AI_TOOL_INPUT, GEN_AI_TOOL_NAME, GEN_AI_TOOL_OUTPUT, GEN_AI_TOOL_TYPE, @@ -109,7 +109,7 @@ export function wrapToolsWithSpans(tools: unknown[], options: LangGraphOptions, if (options.recordInputs) { const toolArgs = 'args' in input && typeof input.args === 'object' ? input.args : input; try { - spanAttributes[GEN_AI_TOOL_INPUT] = JSON.stringify(toolArgs); + spanAttributes[GEN_AI_TOOL_CALL_ARGUMENTS] = JSON.stringify(toolArgs); } catch { // skip if not serializable } diff --git a/packages/server-utils/src/ai/vercel-ai/index.ts b/packages/server-utils/src/ai/vercel-ai/index.ts index 1fb9b96eeb69..fa15651c7215 100644 --- a/packages/server-utils/src/ai/vercel-ai/index.ts +++ b/packages/server-utils/src/ai/vercel-ai/index.ts @@ -20,9 +20,9 @@ import { GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MODEL, GEN_AI_RESPONSE_MODEL, + GEN_AI_TOOL_CALL_ARGUMENTS, GEN_AI_TOOL_DEFINITIONS, GEN_AI_TOOL_DESCRIPTION, - GEN_AI_TOOL_INPUT, GEN_AI_TOOL_NAME, GEN_AI_TOOL_OUTPUT, GEN_AI_TOOL_TYPE, @@ -320,7 +320,7 @@ export function processVercelAiSpanAttributes(attributes: Record, recordInputs: boolean): S ...(toolName ? { [GEN_AI_TOOL_NAME]: toolName } : {}), ...(toolCallId ? { [GEN_AI_TOOL_CALL_ID_ATTRIBUTE]: toolCallId } : {}), ...(description ? { [GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE]: description } : {}), - ...(recordInputs && toolInput !== undefined ? { [GEN_AI_TOOL_INPUT]: stringify(toolInput) } : {}), + ...(recordInputs && toolInput !== undefined ? { [GEN_AI_TOOL_CALL_ARGUMENTS]: stringify(toolInput) } : {}), }); }