- Configure an OpenTelemetry (OTEL) trace exporter (instructions differ for Next.js and Node.js).
- Instrument your Vercel AI SDK calls and attach Raindrop metadata (common to both).
Setting up OpenTelemetry in Next.js
First, install the required OpenTelemetry packages.instrumentation.ts
file.
Setting up OpenTelemetry in Node.js
For Node.js applications, first install the required OpenTelemetry packages.Instrumenting AI SDK Calls
To instrument your AI SDK calls:- Enable
experimental_telemetry: { isEnabled: true }
at all AI SDK call sites - Add Raindrop metadata at the top-level call that handles user input and produces the final output using
raindrop.metadata()