Skip to content

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

Open
nicohrubec wants to merge 1 commit into
ref/genai-system-to-provider-namefrom
ref/genai-available-tools-to-tool-definitions
Open

ref(core)!: Rename gen_ai.request.available_tools to gen_ai.tool.definitions#22820
nicohrubec wants to merge 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 📦

Path Size % Change Change
@sentry/browser 29.82 kB - -
@sentry/browser - with treeshaking flags 28.02 kB - -
@sentry/browser (incl. Tracing) 47.08 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.09 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.82 kB - -
@sentry/browser (incl. Tracing, Replay) 86.39 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.83 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.11 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 103.76 kB - -
@sentry/browser (incl. Feedback) 47.13 kB - -
@sentry/browser (incl. sendFeedback) 34.66 kB - -
@sentry/browser (incl. FeedbackAsync) 39.76 kB - -
@sentry/browser (incl. Metrics) 30.89 kB - -
@sentry/browser (incl. Logs) 31.12 kB - -
@sentry/browser (incl. Metrics & Logs) 31.8 kB - -
@sentry/react 31.6 kB - -
@sentry/react (incl. Tracing) 49.33 kB - -
@sentry/vue 34.74 kB - -
@sentry/vue (incl. Tracing) 49.05 kB - -
@sentry/svelte 29.85 kB - -
CDN Bundle 31.87 kB - -
CDN Bundle (incl. Tracing) 47.45 kB - -
CDN Bundle (incl. Logs, Metrics) 33.42 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 48.82 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.78 kB - -
CDN Bundle (incl. Tracing, Replay) 85.08 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.38 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 90.85 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.16 kB - -
CDN Bundle - uncompressed 95.04 kB - -
CDN Bundle (incl. Tracing) - uncompressed 142.27 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.75 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.25 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.51 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.52 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.49 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.23 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.18 kB - -
@sentry/nextjs (client) 51.92 kB - -
@sentry/sveltekit (client) 47.51 kB - -
@sentry/core/server 79.58 kB -0.01% -3 B 🔽
@sentry/core/browser 51.58 kB - -
@sentry/node 121.27 kB -0.01% -1 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B - -
@sentry/node - without tracing 84.77 kB - -
@sentry/aws-serverless 93.02 kB +0.01% +3 B 🔺
@sentry/cloudflare (withSentry) - minified 197.59 kB - -
@sentry/cloudflare (withSentry) 485.77 kB - -

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
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 🤔

(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.

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
…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 7034b34 to 69fd4c9 Compare July 30, 2026 05:15
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