Sentry Cookbook
Code breaks. These recipes fix it.
Recipes
Find out why your Next.js checkout fails silently
Your checkout page shows no errors, but orders are down. Surface the failures your code swallows, then use logs, traces, and Session Replay to find the cause, hand it to Seer for a fix, and get alerted the next time checkout success drops.
Instrument a Shopify Hydrogen storefront with Sentry
A headless storefront splits every page across the browser, the Oxygen worker, and Shopify's Storefront API. Trace all three, give every Storefront API query a name you can search, and catch the cart errors that never throw an exception.
Monitor Stripe webhooks in Next.js with Sentry
Stripe webhooks fulfill orders, renew subscriptions, and flag failed payments. When one breaks, it often doesn't throw an error, so nothing reaches your monitoring and you might not find out for days. Track every event your Next.js app receives, catch handler failures with the event ID you need to resend them, and get alerted when events slow down or stop arriving.
Send Shopify Hydrogen OpenTelemetry traces to Sentry
Shopify can export traces from your Hydrogen storefront on Oxygen in OpenTelemetry format. Point them at Sentry to see request timing, Storefront API queries, cache hits and misses, and third-party calls, without changing any code.
Connect Sentry to Devin Oncall
Give Devin access to Sentry context to help it investigate active issues, propose code fixes, and help with incidents affecting production.
Trace Claude Managed Agents and the Messages API in Sentry
The Claude Platform exports OpenTelemetry (OTel) traces natively. Select Sentry as a destination in the Claude Console, paste your DSN, and see every model call, tool call, and token from Claude Managed Agents and the Messages API, with no code to change.
Trace the Claude Python SDK in Sentry with OpenTelemetry
The Claude SDK emits OpenTelemetry (OTel) spans for each request and for each tool that the tool runner runs. Point an OTLP exporter at Sentry and see your agent's model calls, tool calls, and tokens under your own application spans.
Trace the Claude TypeScript SDK in Sentry with OpenTelemetry
The Claude SDK emits OpenTelemetry (OTel) spans for each request and for each tool that the tool runner runs. Point an OTLP exporter at Sentry and see your agent's model calls, tool calls, and tokens under your own application spans.
Set up Sentry in an Expo React Native app
Wire up Sentry's React Native SDK in an Expo project so you get readable, source-mapped crash reports and performance traces straight from your devices.
Monitor a Mistral Support Agent With Sentry
Trace Mistral’s model calls in a working support assistant. Inspect prompts, tool requests, tokens, and streamed replies, then add application spans when you need them.
Customize Session Replay capture with a custom hook
Create a custom hook in React that lets you set Session Replay sampling rates by page, element, or action — so you capture exactly the sessions you care about.
Instrument Flue agents with Sentry
Use Flue's official Sentry blueprint to trace agent runs, inspect tool calls, correlate logs, and capture terminal failures.
Instrument Vercel eve agents with Sentry
Use Vercel eve's official Sentry instrumentation to send agent traces directly to Sentry over OTLP. No Sentry SDK is required.
Monitor AI agent spend with dashboards and alerts
Build a shared Sentry dashboard for AI agent cost, tokens, and top spenders, then get alerted when hourly spend breaches your budget or spikes. The dashboard the script builds is literally 'LLM Spend per User'.
Monitor Neon Functions with Sentry
Add error tracking, structured logs, request tracing, and AI agent observability to your Neon Functions with the standard Sentry Node SDK — no wrapper or special runtime required.
Structure your logs for faster debugging
Replace noisy console.log and print statements with structured, queryable log events — stable event names, dot-notated keys, and context that travels with every request — so the data you need to debug a failure is already there.
Automate daily AI agent error triage with Claude Routines and Sentry
A Claude Routine reads your agent's overnight conversations, flags tool errors and reasoning failures, and files tickets before you've had your coffee.
Investigate and fix issues with Seer Agent
Ask Seer Agent what broke and why in plain language, in Sentry or Slack, and it reasons over your errors, traces, logs, and code to find the root cause, then kicks off a fix.
Build a dashboard and alert from custom metrics in a Next.js app
Emit one custom metric from a Next.js Server Action, then turn it into a dashboard widget and a threshold or anomaly alert that fires the moment things drift — trace-connected, so a spike is one click from the request behind it.
Use production AI agent conversations in your evals
Export your users' real AI agent conversations from Sentry and turn them into eval datasets you score in Braintrust, Langfuse, promptfoo, or Phoenix. Real traffic becomes your ground-truth test set.
Install the Sentry plugin in your coding agent
One command installs the Sentry plugin in your coding agent, so it can set up Sentry, fix errors, configure alerts, and more.
Connect your GitLab source code to Sentry
Connect GitLab to Sentry so errors point straight at the code that caused them. You'll create an application in GitLab, link groups, and add repositories to unlock code mapping, stack trace linking, and Seer.
Build an automated debugging workflow with Seer
Let Sentry help fix issues for you. Sentry captures issues with full context of your application, Seer pinpoints the root cause, and ships the fix as a pull request using Seer or the agent of your choice. All done automatically or with a human in the loop, whatever works for you.
Debug and resolve issues with Sentry MCP and Warp
Connect the Sentry MCP server to Warp so your AI terminal agent can pull issues, read traces and logs, call Seer for a root-cause analysis, and apply the fix.
Analyze and fix issues from Slack with Seer
Use the Sentry Slack integration to query the Seer agent, trigger Autofix from alert notifications, and debug issues without leaving Slack.
Turn Supabase security advisories into Sentry issues
Use the Supabase and Sentry MCP servers in Claude Code to turn security advisories (like missing RLS policies) into trackable Sentry issues, then schedule the check to run daily.
Set up a monitor and alert from a Supabase log drain
Pipe your Supabase infrastructure logs into Sentry, then filter, monitor, and alert on dropped database connections and edge-function errors — without babysitting the Supabase dashboard.
Auto-fix regressed Sentry issues with Cursor Automations
When a resolved Sentry issue resurfaces, a Cursor agent investigates the regression vector, reads the relevant code, and opens a PR — no manual triage needed.
Send Vercel AI SDK telemetry to Sentry via OpenTelemetry
Keep your existing Vercel AI SDK and @vercel/otel setup, and export your LLM spans to Sentry over OTLP. Sentry still captures your errors and links them to the active trace.
Auto-triage and fix User Feedback with Cursor Automations and Sentry MCP
Trigger a Cursor agent the moment user feedback is assigned in Sentry. It reads the issue, finds the relevant code, and opens a PR.
Route your existing OpenTelemetry traces to Sentry with Next.js
Keep your vendor-neutral OpenTelemetry instrumentation and start seeing your Next.js traces in Sentry. No SDK migration required.
Create Sentry Dashboards with your AI coding agent
Point your AI coding agent at the Sentry CLI and it builds dashboards tailored to your codebase, with no manual widget configuration required.
Write incident playbooks in Sentry Dashboards using markdown widgets
Put your incident runbook inside a Sentry dashboard as a markdown text widget, so on-call sees the triage steps right next to the metrics they reference.
Debug faster with Sentry MCP and Claude Code
Connect Sentry to Claude Code with the Sentry MCP server so your AI coding agent can pull issues, read traces and logs, find the root cause, and apply the fix.
Monitor your AI agent costs and calls in Next.js
Add Sentry to your Next.js app to see Vercel AI SDK token usage, LLM costs, tool calls, and agent traces with full-stack trace context. Spot which models drive spend without leaving Sentry.
Monitor your pi coding agent sessions with Sentry
Add the official @sentry/pi extension to get full visibility into tool calls, token usage, and model costs across every pi session.
Monitor Claude Code usage and costs with Sentry
Add the claude-code-sentry-monitor plugin to track token usage, session costs, and tool activity across every Claude Code session, without touching your project code.
Monitor your OpenCode sessions with Sentry
Add the opencode-sentry-monitor plugin to get full visibility into tool calls, token usage, and model costs across every OpenCode session.
Auto-create and triage issues in Linear for your worst bugs
Use the Sentry Linear integration to auto-create a Linear issue the moment an error fires, then assign the Sentry agent to run root cause analysis and suggest a code fix, all without leaving Linear.
Automate weekly performance triage with Claude Code + Sentry MCP
Set up a recurring Claude Code task that queries Sentry for your slowest endpoints every Monday, analyzes the root cause, and opens a GitHub PR with the fix. No custom bot infrastructure required.
Debug undefined properties in React Native with Sentry Logs
Use Sentry Logs from both your React Native app and backend to tell whether an undefined property is a first-render timing issue or actually missing from the API response — no more guessing.
Fix production issues in Cursor using the Sentry MCP server and Seer
Use the Sentry MCP server in Cursor to pull issues from your projects, trigger Seer root cause analysis, and apply fixes directly in your IDE — no copy-pasting stack traces required.
Monitor your MCP server with Sentry
Initialize Sentry and your MCP server is instrumented automatically. Get full visibility into client activity, transport distribution, tool and resource performance, and errors, including the silent ones MCP hides from you.
Replace console.log with structured, trace-connected logging using LogTape and Sentry
Wire up LogTape with Sentry in a Next.js app to replace console.log with structured, trace-connected log events you can query, alert on, and tie back to the exact request that broke.
Track and fix checkout performance in React Native with Sentry tracing
Instrument tracing across a React Native app and Python backend to pinpoint the slow HTTP requests in your checkout flow, fix them, and set up alerts and dashboards that catch the next regression.
No recipes match your filters.
Fix it
Get started with the only application monitoring platform that empowers developers to fix application problems without compromising on velocity.