Build AI Agent Observability with Sentry + Vercel Analytics (2026)
Sentry's 2026 Agent Monitoring auto-instruments OpenAI, Anthropic, Vercel AI SDK, and LangGraph. Pair with Vercel Web Analytics for full client + server visibility.
TL;DR — Sentry's April 2026 update auto-instruments OpenAI, Anthropic, Google GenAI, LangChain, LangGraph, OpenAI Agents SDK, and Vercel AI SDK. Token, tool, and span data lands in Sentry Agent Insights with no manual span code.
What you'll build
A Next.js 15 app with: (1) Sentry capturing every LLM call as a nested span, (2) Vercel Web Analytics tracking conversion to "first message", and (3) OpenTelemetry export from Vercel AI SDK to Sentry.
Prerequisites
@sentry/nextjs@^9,@vercel/analytics@^1.4.- Sentry org with AI Agent Monitoring enabled.
- Vercel project for hosting.
Architecture
flowchart LR
UI[Next.js client] --> VA[Vercel Analytics]
UI --> API[/api/chat/]
API --> AI[Vercel AI SDK]
AI -- OTel spans --> SE[Sentry AI Insights]
AI -- LLM call --> OA[OpenAI]
SE --> AL[Alerts: token spike · tool fail · p95 lat]
Step 1 — Sentry init
```ts // instrumentation.ts import * as Sentry from "@sentry/nextjs"; export function register() { Sentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 1.0, profilesSampleRate: 0.1, integrations: [Sentry.openAIIntegration({ recordInputs: true, recordOutputs: false, // PII! })], }); } ```
Step 2 — Wrap a chat route
```ts // app/api/chat/route.ts import { streamText } from "ai"; import { openai } from "@ai-sdk/openai";
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
export async function POST(req: Request) { const { messages } = await req.json(); const result = streamText({ model: openai("gpt-4o-mini"), messages, experimental_telemetry: { isEnabled: true, functionId: "chat", metadata: { tenantId: "demo" } }, }); return result.toDataStreamResponse(); } ```
Step 3 — Vercel AI SDK → Sentry via OTel
```ts // instrumentation.ts (server) import { registerOTel } from "@vercel/otel"; import { SentrySpanProcessor, SentryPropagator } from "@sentry/opentelemetry"; registerOTel({ serviceName: "agent-app", spanProcessors: [new SentrySpanProcessor()], propagators: [new SentryPropagator()], }); ```
Step 4 — Vercel Web Analytics
```tsx // app/layout.tsx import { Analytics } from "@vercel/analytics/react"; export default function RootLayout({ children }: any) { return (
{children}Step 5 — Custom event for "first message"
```ts import { track } from "@vercel/analytics"; track("first_message_sent", { plan: "pro" }); ```
Step 6 — Sample at 100% with span budgets
Sentry's 2026 "AI traces at 100%" feature lets you keep every LLM span without sampling tools or routes. Enable per-project span budget in Settings → Performance.
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
Pitfalls
- PII leakage:
recordInputs: truewrites prompt text — redact or disable in HIPAA/GDPR contexts. - Span explosions: Very long agent loops can produce 1000+ spans/run; set
maxSpans: 200. - Edge runtime: Some Sentry integrations require
runtime = "nodejs".
How CallSphere does this in production
CallSphere streams 37 agent spans into Sentry across 6 verticals with 90+ tools and 115+ DB tables. Token-spike alerts fire to Slack within 30s. Healthcare (FastAPI), OneRoof (Next.js 16 + React 19), Salon (NestJS 10 + Prisma), Sales (Node.js 20 + React 18 + Vite). $149/$499/$1,499, 14-day trial, 22% affiliate.
FAQ
Sentry pricing for AI? Same as regular tracing — 1M spans free, then ~$0.10/100K spans.
Replace LangSmith? For pure observability yes — but LangSmith has dataset + eval features Sentry lacks.
Privacy mode? Set recordInputs/Outputs: false and Sentry only stores metadata + token counts.
Seer (auto-RCA)? Sentry's AI debugging agent ships RCA at 94.5% accuracy on 2026 benchmarks.
Sources
- Sentry AI Observability - https://sentry.io/solutions/ai-observability/
- Sentry Agent Monitoring update - https://blog.sentry.io/sentrys-updated-agent-monitoring/
- Vercel AI SDK + Sentry OTel - https://sentry.io/cookbook/vercel-ai-sdk-otel-sentry/
- Sentry sample 100% AI traces - https://blog.sentry.io/sample-ai-traces-at-100-percent-without-sampling-everything/
Try CallSphere AI Voice Agents
See how AI voice agents work for your industry. Live demo available -- no signup required.