new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

sentry/setup

7 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Sentry observability provider overview

Sentry helps monitor errors, traces, latency, and token usage for AI applications. Sentry's Next.js and Node.js SDKs instrument AI SDK v7 through the native Node.js telemetry channel, so registerTelemetry and @ai-sdk/otel are not required.

Sentry version requirement for AI SDK v7

AI SDK v7 support requires @sentry/node, @sentry/nextjs, or another Sentry server SDK version 10.62.0 or later. The native telemetry channel is available in the Node.js runtime.

Sentry Next.js setup

Install @sentry/nextjs and create or update sentry.server.config.ts with Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, tracesSampleRate: 1.0 }). If setting up Sentry manually in Next.js, make sure instrumentation.ts loads the server config for the Node.js runtime by checking process.env.NEXT_RUNTIME === 'nodejs'.

Sentry Node.js setup

Install @sentry/node and initialize Sentry at the start of your server entry point with Sentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 1.0 }).

Sentry Vercel AI integration default behavior

The Vercel AI integration is enabled by default in Sentry server SDKs. If you have disabled default integrations, add it back explicitly with integrations: [Sentry.vercelAIIntegration()].

Sentry telemetry usage example with Next.js

Example: Use the AI SDK normally with telemetry option including functionId. No registerTelemetry or telemetry.isEnabled flag is required. ```ts import { anthropic } from '@ai-sdk/anthropic'; import { generateText } from 'ai'; export const runtime = 'nodejs'; export async function POST() { const result = await generateText({ model: anthropic('claude-sonnet-4-5'), prompt: 'What is the weather in Tokyo?', telemetry: { functionId: 'anthropic-weather-demo', }, }); return Response.json({ text: result.text }); } ```

Sentry telemetry usage example with Node.js script

For a standalone Node.js script, wrap the AI SDK call in a Sentry span so the AI spans have a parent trace, then flush before the process exits. ```ts import './instrumentation'; import * as Sentry from '@sentry/node'; import { openai } from '@ai-sdk/openai'; import { generateText } from 'ai'; await Sentry.startSpan({ name: 'ai-sdk-demo' }, async () => { const result = await generateText({ model: openai('gpt-5-mini'), prompt: 'Write a haiku about observability.', telemetry: { functionId: 'haiku-demo', }, }); console.log(result.text); }); await Sentry.flush(2000); ```

Give your agent this brain