Track all agent runs, error rates, LLM calls, tokens used, and tool executions. Monitor traffic patterns and duration metrics across your AI-powered features.
AI, LLM, and Agent Observability
Agents, LLMs, vector stores, custom logic: visibility can’t stop at the model call.
Trace every agent run end to end and get the context you need to debug failures, optimize performance, and keep AI features reliable.
Tolerated by 4 million developers
- Anthropic
- Cursor
- GitHub
- Vercel
- Microsoft
- Bolt
- Factory AI
- Cognition
- Pinecone
- ElevenLabs
- Glean
- Harvey
- Mistral
- Replit
- Vapi
Full LLM Observability
Track Model Costs & Tokens
Monitor spending across models.
Compare costs across different models. See token usage breakdown by model, track input vs output tokens, and identify expensive operations.
Agent tracing, end to end
Trace every agent run, end to end.
AI agents fail across a chain of steps, not a single line of code. Agent tracing stitches every LLM call, tool execution, and handoff into one connected trace, with full prompt and response context, token counts, cost, and timing on every span. Follow the trace to the exact tool or step that went wrong, and apply agent tracing best practices to keep runs reliable as they scale.
Cookbook recipes
Monitor your AI agent costs and calls in Next.js
Add Sentry's Vercel AI integration to your Next.js app to track LLM token usage, per-model costs, tool calls, and agent traces with full-stack trace context.
Monitor your MCP server with Sentry
Add monitoring to your own Node.js or Python MCP server with one line of code. Track clients, transports, tool performance, error rates, and trace each request.
Monitor Claude Code usage and costs with Sentry
Track Claude Code token usage, API costs, and tool activity with Sentry AI Observability. Set up OpenTelemetry-based observability for your Claude Code sessions in minutes.
Monitor your OpenCode sessions with Sentry
Add Sentry AI observability to OpenCode in minutes. Track tool calls, token usage, model costs, and session durations across every coding session.
Monitor your pi coding agent sessions with Sentry
Add Sentry AI observability to pi in minutes. Track tool calls, LLM calls, token usage, and model costs across every pi coding session.
Use production AI agent conversations in your evals
Export real AI agent conversations from Sentry with the CLI or MCP server and turn them into eval datasets in Braintrust, Langfuse, promptfoo, or Phoenix.
Send Vercel AI SDK telemetry to Sentry via OpenTelemetry
Keep your existing Vercel AI SDK and OpenTelemetry setup, and route LLM spans to Sentry's AI Agents Insights without ripping out @vercel/otel.
Automate daily AI agent error triage with Claude Routines and Sentry
Set up a Claude Routine that uses Sentry Agent Tracing via MCP to automatically triage your AI agent's overnight errors, sample conversations, and file tickets
Install the Sentry plugin in your coding agent
Install the Sentry plugin in Claude Code, Cursor, Codex, or Grok with one command, then use prompts for setup, debugging, monitoring, and code review.
Instrument Flue agents with Sentry
Add Sentry to a Flue agent. Trace model calls and tools, correlate logs, and capture terminal agent failures as Sentry Issues.
Instrument Eve agents with Sentry
Instrument an Eve agent with Sentry and inspect its conversations, model calls, tool executions, tokens, and latency.
Monitor AI agent spend with dashboards and alerts
Build a Sentry dashboard with the CLI for AI agent cost, tokens, top spenders, and models, then add static and anomaly detectors that alert when hourly spend spikes.
Getting started with Sentry is simple
Get started with just a few lines of code.
Install sentry-sdk from PyPI:
pip install "sentry-sdk"Add OpenAIAgentsIntegration() to your integrations list:
import sentry_sdk
from sentry_sdk.integrations.openai_agents import OpenAIAgentsIntegration
sentry_sdk.init(
# Configure your DSN
dsn="https://examplePublicKey@o0.ingest.sentry.io/0",
# Add data like inputs and responses to/from LLMs and tools;
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,
integrations=[
OpenAIAgentsIntegration(),
],
)The vercelAIIntegration adds instrumentation for the ai SDK by Vercel to capture spans using the AI SDK's built-in Telemetry. Get started with the following snippet:
Sentry.init({
// Configure your DSN
dsn: 'https://<key>@sentry.io/<project>',
tracesSampleRate: 1.0,
integrations: [
Sentry.vercelAIIntegration({
recordInputs: true,
recordOutputs: true,
}),
],
});To correctly capture spans, pass the experimental_telemetry object with isEnabled: true to every generateText, generateObject, and streamText function call.
const result = await generateText({
model: openai("gpt-4o"),
experimental_telemetry: {
isEnabled: true,
},
});
increase in developer productivity
engineers rely on Sentry to ship code
faster incident resolution
AI observability FAQ
Fix what's broken with LLM Observability
Get started with the only LLM observability platform that gives developers tools to fix application problems without compromising on velocity.