Skip to content

ref(core)!: Rename gen_ai.request.available_tools to gen_ai.tool.definitions - #22820

Merged
nicohrubec merged 1 commit into
ref/genai-system-to-provider-namefrom
ref/genai-available-tools-to-tool-definitions
Aug 5, 2026
Merged

ref(core)!: Rename gen_ai.request.available_tools to gen_ai.tool.definitions#22820
nicohrubec merged 1 commit into
ref/genai-system-to-provider-namefrom
ref/genai-available-tools-to-tool-definitions

Conversation

@nicohrubec

Copy link
Copy Markdown
Member

Switches all AI integrations from the deprecated gen_ai.request.available_tools attribute to its @sentry/conventions replacement gen_ai.tool.definitions.

Part of #22482

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.81 kB - -
@sentry/browser - with treeshaking flags 28.03 kB - -
@sentry/browser (incl. Tracing) 47.28 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.29 kB - -
@sentry/browser (incl. Tracing, Profiling) 52.05 kB - -
@sentry/browser (incl. Tracing, Replay) 86.6 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.04 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.33 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 103.97 kB - -
@sentry/browser (incl. Feedback) 47.13 kB - -
@sentry/browser (incl. sendFeedback) 34.66 kB - -
@sentry/browser (incl. FeedbackAsync) 39.77 kB - -
@sentry/browser (incl. Metrics) 30.88 kB - -
@sentry/browser (incl. Logs) 31.12 kB - -
@sentry/browser (incl. Metrics & Logs) 31.79 kB - -
@sentry/react 31.61 kB - -
@sentry/react (incl. Tracing) 49.54 kB - -
@sentry/vue 34.88 kB - -
@sentry/vue (incl. Tracing) 49.27 kB - -
@sentry/svelte 29.83 kB - -
CDN Bundle 31.9 kB - -
CDN Bundle (incl. Tracing) 47.6 kB - -
CDN Bundle (incl. Logs, Metrics) 33.45 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.02 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.81 kB - -
CDN Bundle (incl. Tracing, Replay) 85.26 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.57 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.08 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.4 kB - -
CDN Bundle - uncompressed 94.8 kB - -
CDN Bundle (incl. Tracing) - uncompressed 142.47 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.51 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.44 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.26 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.72 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.69 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.43 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.38 kB - -
@sentry/nextjs (client) 52.1 kB - -
@sentry/sveltekit (client) 47.72 kB - -
@sentry/core/server 65.53 kB - -
@sentry/core/browser 51.87 kB - -
@sentry/node 120.65 kB -0.01% -1 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 84.03 kB -0.01% -1 B 🔽
@sentry/aws-serverless 92.69 kB +0.01% +2 B 🔺
@sentry/cloudflare (withSentry) - minified 218.61 kB -0.02% -24 B 🔽
@sentry/cloudflare (withSentry) 538.64 kB -0.01% -8 B 🔽

View base workflow run

@nicohrubec
nicohrubec marked this pull request as ready for review July 29, 2026 12:42
@nicohrubec
nicohrubec requested review from a team as code owners July 29, 2026 12:42
@nicohrubec
nicohrubec requested review from andreiborza, isaacs and mydea and removed request for a team July 29, 2026 12:42
@@ -59,7 +59,7 @@ export function extractRequestAttributes(
if (args.length > 0 && typeof args[0] === 'object' && args[0] !== null) {
const params = args[0] as Record<string, unknown>;
if (params.tools && Array.isArray(params.tools)) {
attributes[GEN_AI_REQUEST_AVAILABLE_TOOLS] = JSON.stringify(params.tools);
attributes[GEN_AI_TOOL_DEFINITIONS] = JSON.stringify(params.tools);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: Should we be more defensive with stringifying here? I think we have a helper for that now 🤔

@@ -125,7 +125,7 @@ export function extractRequestAttributes(
const functionDeclarations = config.tools.flatMap(
(tool: { functionDeclarations: unknown[] }) => tool.functionDeclarations,
);
attributes[GEN_AI_REQUEST_AVAILABLE_TOOLS] = JSON.stringify(functionDeclarations);
attributes[GEN_AI_TOOL_DEFINITIONS] = JSON.stringify(functionDeclarations);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here too, more defensive stringifying.

@@ -206,7 +206,7 @@ export function instrumentCompiledGraphInvoke(
// Extract available tools from the graph instance
const tools = extractToolsFromCompiledGraph(graphInstance);
if (tools) {
span.setAttribute(GEN_AI_REQUEST_AVAILABLE_TOOLS, JSON.stringify(tools));
span.setAttribute(GEN_AI_TOOL_DEFINITIONS, JSON.stringify(tools));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here.

@nicohrubec
nicohrubec force-pushed the ref/genai-available-tools-to-tool-definitions branch from 485d347 to 7034b34 Compare July 29, 2026 14:02
@nicohrubec
nicohrubec force-pushed the ref/genai-available-tools-to-tool-definitions branch from 7034b34 to 69fd4c9 Compare July 30, 2026 05:15
@nicohrubec
nicohrubec marked this pull request as draft July 31, 2026 07:29
…efinitions`

Emit the `gen_ai.tool.definitions` attribute from `@sentry/conventions` instead
of the deprecated `gen_ai.request.available_tools` alias across all AI
integrations (OpenAI, Anthropic, Google GenAI, LangChain, LangGraph, Vercel AI).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nicohrubec
nicohrubec force-pushed the ref/genai-available-tools-to-tool-definitions branch from 69fd4c9 to 4d2e97b Compare August 4, 2026 13:24
@nicohrubec
nicohrubec marked this pull request as ready for review August 5, 2026 11:44
@nicohrubec
nicohrubec merged commit 5b8aa00 into develop Aug 5, 2026
517 of 519 checks passed
@nicohrubec
nicohrubec deleted the ref/genai-available-tools-to-tool-definitions branch August 5, 2026 12:25
JPeer264 added a commit to getsentry/sentry-conventions that referenced this pull request Aug 27, 2026
`gen_ai.request.available_tools`, `ai.tools` and `ai.prompt.tools` all
replace onto `gen_ai.tool.definitions`, but none of the four named the
others. `gen_ai.request.available_tools` even carried an empty `alias`
array, and `ai.tools` had none at all, which is why the symmetry test stayed
green. All four now list each other.

Replaced by getsentry/sentry-javascript#22820

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JPeer264 added a commit to getsentry/sentry-conventions that referenced this pull request Aug 27, 2026
`gen_ai.request.available_tools`, `ai.tools` and `ai.prompt.tools` all
replace onto `gen_ai.tool.definitions`, but none of the four named the
others. `gen_ai.request.available_tools` even carried an empty `alias`
array, and `ai.tools` had none at all, which is why the symmetry test stayed
green. All four now list each other.

Replaced by getsentry/sentry-javascript#22820

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JPeer264 added a commit to getsentry/sentry-conventions that referenced this pull request Aug 27, 2026
`gen_ai.request.available_tools`, `ai.tools` and `ai.prompt.tools` all
replace onto `gen_ai.tool.definitions`, but none of the four named the
others. `gen_ai.request.available_tools` even carried an empty `alias`
array, and `ai.tools` had none at all, which is why the symmetry test stayed
green. All four now list each other.

Replaced by getsentry/sentry-javascript#22820

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JPeer264 added a commit to getsentry/sentry-conventions that referenced this pull request Aug 27, 2026
`gen_ai.request.available_tools`, `ai.tools` and `ai.prompt.tools` all
replace onto `gen_ai.tool.definitions`, but none of the four named the
others. `gen_ai.request.available_tools` even carried an empty `alias`
array, and `ai.tools` had none at all, which is why the symmetry test stayed
green. All four now list each other.

Replaced by getsentry/sentry-javascript#22820

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JPeer264 added a commit to getsentry/sentry-conventions that referenced this pull request Aug 27, 2026
`gen_ai.request.available_tools`, `ai.tools` and `ai.prompt.tools` all
replace onto `gen_ai.tool.definitions`, but none of the four named the
others. `gen_ai.request.available_tools` even carried an empty `alias`
array, and `ai.tools` had none at all, which is why the symmetry test stayed
green. All four now list each other.

Replaced by getsentry/sentry-javascript#22820

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JPeer264 added a commit to getsentry/sentry-conventions that referenced this pull request Aug 27, 2026
`gen_ai.request.available_tools`, `ai.tools` and `ai.prompt.tools` all
replace onto `gen_ai.tool.definitions`, but none of the four named the
others. `gen_ai.request.available_tools` even carried an empty `alias`
array, and `ai.tools` had none at all, which is why the symmetry test stayed
green. All four now list each other.

Replaced by getsentry/sentry-javascript#22820

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JPeer264 added a commit to getsentry/sentry-conventions that referenced this pull request Aug 27, 2026
`gen_ai.request.available_tools`, `ai.tools` and `ai.prompt.tools` all
replace onto `gen_ai.tool.definitions`, but none of the four named the
others. `gen_ai.request.available_tools` even carried an empty `alias`
array, and `ai.tools` had none at all, which is why the symmetry test stayed
green. All four now list each other.

Replaced by getsentry/sentry-javascript#22820

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JPeer264 added a commit to getsentry/sentry-conventions that referenced this pull request Aug 28, 2026
`gen_ai.request.available_tools`, `ai.tools` and `ai.prompt.tools` all
replace onto `gen_ai.tool.definitions`, but none of the four named the
others. `gen_ai.request.available_tools` even carried an empty `alias`
array, and `ai.tools` had none at all, which is why the symmetry test stayed
green. All four now list each other.

Replaced by getsentry/sentry-javascript#22820

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JPeer264 added a commit to getsentry/sentry-conventions that referenced this pull request Aug 28, 2026
`gen_ai.request.available_tools`, `ai.tools` and `ai.prompt.tools` all
replace onto `gen_ai.tool.definitions`, but none of the four named the
others. `gen_ai.request.available_tools` even carried an empty `alias`
array, and `ai.tools` had none at all, which is why the symmetry test stayed
green. All four now list each other.

Replaced by getsentry/sentry-javascript#22820

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JPeer264 added a commit to getsentry/sentry-conventions that referenced this pull request Aug 28, 2026
`gen_ai.request.available_tools`, `ai.tools` and `ai.prompt.tools` all
replace onto `gen_ai.tool.definitions`, but none of the four named the
others. `gen_ai.request.available_tools` even carried an empty `alias`
array, and `ai.tools` had none at all, which is why the symmetry test stayed
green. All four now list each other.

Replaced by getsentry/sentry-javascript#22820

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants