Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions weave/guides/integrations/vercel_ai_sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Next.js applications use an `instrumentation.ts` file to set up OTel. This file

To integrate Weave with Vercel's OTel functionality, create an `instrumentation.ts` file in your project root and add the following code to it, updating the `resourceFromAttributes()` function with your team and project names:

```typescript twoslash instrumentation.ts lines {17-19}
```typescript twoslash lines {17-19} title="instrumentation.ts"
// @noErrors
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-base";
Expand Down Expand Up @@ -74,7 +74,7 @@ This creates an OTLP exporter configured to send trace data to Weave's OTel endp

After you've added the instrumentation, use Vercel's `experimental_telemetry` option on any AI SDK function call to emit OTel spans:

```typescript twoslash route.ts lines {10}
```typescript twoslash lines {10} title="route.ts"
// @noErrors
import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";
Expand Down
Loading