From c3fd6e380258b8816bc3f9fae4a097c2e2e948dd Mon Sep 17 00:00:00 2001 From: JPeer264 Date: Fri, 17 Jul 2026 10:11:35 +0200 Subject: [PATCH 1/2] docs(vercelai): Align types based on implementation --- .../configuration/integrations/vercelai.mdx | 46 ++++++++++++++++--- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/docs/platforms/javascript/common/configuration/integrations/vercelai.mdx b/docs/platforms/javascript/common/configuration/integrations/vercelai.mdx index d0ff5f4bf4a4d..f62bc5843fa2a 100644 --- a/docs/platforms/javascript/common/configuration/integrations/vercelai.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/vercelai.mdx @@ -44,7 +44,7 @@ _Import name: `Sentry.vercelAIIntegration`_ The `vercelAIIntegration` adds instrumentation for the [`ai`](https://www.npmjs.com/package/ai) SDK by Vercel to capture spans using the [`AI SDK's built-in Telemetry`](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry). - + It is enabled by default and will automatically capture spans for all `ai` function calls. You can opt-in to capture inputs and outputs by setting `recordInputs` and `recordOutputs` in the integration config: @@ -63,7 +63,7 @@ Sentry.init({ - + This integration is not enabled by default. You need to manually enable it by passing `Sentry.vercelAIIntegration()` to `Sentry.init`: ```javascript @@ -89,7 +89,7 @@ Sentry.init({ - + To correctly capture spans, pass the `experimental_telemetry` object with `isEnabled: true` to every `generateText`, `generateObject`, `streamText`, and `ToolLoopAgent` call. For more details, see the [AI SDK Telemetry Metadata docs](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry#telemetry-metadata). ```javascript @@ -105,9 +105,23 @@ const result = await generateText({ - ## Options +### `enableTruncation` + +_Type: `boolean`_ + +Enables or disables truncation of recorded input messages. Truncation keeps large payloads within span size limits. + +Defaults to `true`. + +```javascript +Sentry.init({ + integrations: [Sentry.vercelAIIntegration({ enableTruncation: false })], +}); +``` + + ### `force` Requires SDK version `9.29.0` or higher. @@ -129,7 +143,9 @@ Sentry.init({ forced when it is enabled. - + + + ### `recordInputs` Requires SDK version `9.27.0` or higher. @@ -164,19 +180,35 @@ Sentry.init({ + +### `recordInputs` and `recordOutputs` + +Setting `recordInputs` and `recordOutputs` on the integration is only supported with AI SDK v7 or higher through the `@sentry/cloudflare/nodejs_compat` entrypoint. On the default entrypoint, Sentry only post-processes spans the AI SDK already emitted and can't decide whether inputs and outputs are recorded. + +To control input and output recording on the default entrypoint, set `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs` per call instead (see [Configuration](#configuration)). + +```javascript +// Only in the `@sentry/cloudflare/nodejs_compat` entrypoint (AI SDK v7+) +Sentry.init({ + integrations: [ + Sentry.vercelAIIntegration({ recordInputs: true, recordOutputs: true }), + ], +}); +``` + ## ToolLoopAgent The integration also captures spans for the [`ToolLoopAgent`](https://ai-sdk.dev/docs/agents/overview#toolloopagent-class) class. Each call to `generate()` or `stream()` creates an agent span with individual LLM requests and tool executions as child spans. - + No additional configuration is needed — `ToolLoopAgent` spans are captured automatically. - + Pass `experimental_telemetry` with `isEnabled: true` to the `ToolLoopAgent` constructor to correctly capture spans: From 2b0c3cc9f83664d5de9cbe7683c4af2e3f454032 Mon Sep 17 00:00:00 2001 From: JPeer264 Date: Fri, 17 Jul 2026 17:39:26 +0200 Subject: [PATCH 2/2] fixup! docs(vercelai): Align types based on implementation --- .../javascript/common/configuration/integrations/vercelai.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/common/configuration/integrations/vercelai.mdx b/docs/platforms/javascript/common/configuration/integrations/vercelai.mdx index f62bc5843fa2a..35576c3327b56 100644 --- a/docs/platforms/javascript/common/configuration/integrations/vercelai.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/vercelai.mdx @@ -185,7 +185,7 @@ Sentry.init({ Setting `recordInputs` and `recordOutputs` on the integration is only supported with AI SDK v7 or higher through the `@sentry/cloudflare/nodejs_compat` entrypoint. On the default entrypoint, Sentry only post-processes spans the AI SDK already emitted and can't decide whether inputs and outputs are recorded. -To control input and output recording on the default entrypoint, set `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs` per call instead (see [Configuration](#configuration)). +To control input and output recording on the default entrypoint, set `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs` directly on each `ai` function call (for example, `generateText`), not on the Sentry integration (see [Configuration](#configuration)). ```javascript // Only in the `@sentry/cloudflare/nodejs_compat` entrypoint (AI SDK v7+)