You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/platforms/javascript/common/configuration/integrations/vercelai.mdx
+12-6Lines changed: 12 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -27,25 +27,31 @@ supported:
27
27
28
28
<Alert>
29
29
30
-
This integration only works in the Node.js and Bun runtimes. Requires SDK version `8.43.0` or higher.
30
+
This integration only works in the Node.js and Bun runtimes. Requires SDK version `9.30.0` or higher.
31
31
32
32
</Alert>
33
33
34
34
_Import name: `Sentry.vercelAIIntegration`_
35
35
36
-
The `vercelAIIntegration` adds instrumentation for the [`ai`](https://www.npmjs.com/package/ai)library by Vercel to capture spans using the [`AI SDK's built-in Telemetry`](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).
36
+
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). Get started with the following snippet:
37
37
38
38
```javascript
39
39
Sentry.init({
40
-
integrations: [Sentry.vercelAIIntegration()],
40
+
tracesSampleRate:1.0,
41
+
integrations: [
42
+
Sentry.vercelAIIntegration({
43
+
recordInputs:true,
44
+
recordOutputs:true,
45
+
}),
46
+
],
41
47
});
42
48
```
43
49
44
50
To enhance the spans collected by this integration, we recommend providing a `functionId` to identify the function that the telemetry data is for. For more details, see the [AI SDK Telemetry Metadata docs](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry#telemetry-metadata).
45
51
46
52
```javascript
47
53
constresult=awaitgenerateText({
48
-
model:openai("gpt-4-turbo"),
54
+
model:openai("gpt-4o"),
49
55
experimental_telemetry: {
50
56
isEnabled:true,
51
57
functionId:"my-awesome-function",
@@ -93,7 +99,7 @@ By default this integration adds tracing support to all `ai` function callsites.
93
99
94
100
```javascript
95
101
constresult=awaitgenerateText({
96
-
model:openai("gpt-4-turbo"),
102
+
model:openai("gpt-4o"),
97
103
experimental_telemetry: { isEnabled:false },
98
104
});
99
105
```
@@ -102,7 +108,7 @@ If you set `experimental_telemetry.recordInputs` and `experimental_telemetry.rec
0 commit comments