Loading…
Your agent can't fix what it can't see
SentrySergiy Dybskiy
Summary
Coding agents frequently fail to resolve production bugs when restricted to source code alone, as they lack critical runtime context such as stack traces, breadcrumbs, and environment data. To bridge this gap, Sentry introduces Sentry MCP and the Sentry CLI to supply agents and developers with structured production telemetry. The Model Context Protocol integration supports clients like Claude Code, Cursor, and VS Code, while the CLI enables scripted workflows. When an alert triggers, an agent uses trace and commit metadata to diagnose root causes across service boundaries, generate regression tests, and open draft pull requests. Over six months, the Autofix pull request merge rate increased from 41% to 46%.
Context
Software debugging agents lack production context such as stack traces, request payloads, environments, and breadcrumbs, leaving them unable to diagnose bugs that only emerge in live environments across diverse user conditions.
Approach / What changed
Sentry created Sentry MCP and the Sentry CLI to provide coding agents with structured access to production telemetry, traces, and Seer root-cause analysis, enabling automated investigation workflows that generate draft pull requests with regression tests.
Takeaways
- Sentry MCP allows MCP-compatible clients like Cursor and Claude Code to access Sentry issues, traces, and Seer analysis without local installation.
- Seer diagnoses root causes in under two minutes, and a complete Autofix run from root cause analysis to opened pull request takes about six minutes.
- The merge rate on Autofix pull requests increased from 41% to 46% over a six-month period as the complexity of diagnosed bugs grew.
Related reading
Sentry ·
Next.js already traces your requests. Here's how to export them with OpenTelemetry.
Next.js provides out-of-the-box tracing for incoming requests, fetch calls, middleware, and server-side rendering, but traces remain invisible without a configured exporter. Developers can use the @vercel/otel package inside an instrumentation file to initialize the OpenTelemetry SDK and transmit traces to any OTLP-compatible destination. While Next.js automatically creates spans for standard request lifecycles, developers can define custom active spans in the Node runtime to capture specific domain operations and contextual attributes. Exporting traces to backends like Sentry requires configuring standard OTLP endpoint and authentication environment variables. Choosing between direct OTLP export via @vercel/otel and the dedicated Sentry SDK depends on requirements, as direct export lacks browser tracing, error monitoring, and Edge custom spans.
Kyle TryonSentry ·
When and what should I be logging?