Every developer has lived this nightmare: it’s 2 AM, your phone buzzes, someone on Slack says “the app is broken,” and you have zero idea why. You open the logs thousands of lines scroll past but nothing tells you what actually broke or who it affected. You’re debugging blind.
This is exactly the problem Sentry was built to solve.
Whether you’re a solo developer maintaining a side project or an engineering lead responsible for a production system serving millions of users, Sentry gives you the full picture when something goes wrong automatically, in real time, with enough context to fix the problem fast.
This guide covers everything you need to know about Sentry errors: what they are, how Sentry captures and groups them, how to set it up from scratch, and the advanced techniques that separate teams who use Sentry effectively from teams who just have a noisy dashboard.
What Is Sentry and Why Does It Matter?
Sentry is an open-source, developer-first application monitoring platform focused on error tracking and performance monitoring. It works across the full stack browser JavaScript, mobile apps, Node.js backends, Python, Go, Java, Ruby, and more than 30 other platforms.
The core promise is simple: when your code breaks in production, Sentry tells you exactly what broke, where it broke, who was affected, and what the user was doing when it happened. No digging through log files, no guessing from a vague user report that says “it doesn’t work.”
Sentry started in 2012 as a small open-source JavaScript error reporter. Today it is used by over 100,000 organizations from early-stage startups to Fortune 500 companies. It is available as a managed cloud service (sentry.io) and as a self-hosted option for teams with data residency requirements.
The reason teams choose Sentry over plain logging comes down to one key insight: logs give you raw text, Sentry gives you grouped, actionable issues. When the same error fires 1,000 times across 1,000 users, your log aggregator shows 1,000 lines. Sentry shows you one issue with a count of 1,000 with the full stack trace, affected users, browser/OS details, and the breadcrumb trail of what happened right before the crash.
Core Concepts You Must Understand
Before diving into setup, you need to be clear on Sentry’s core terminology. These concepts shape everything else.
Organization is the top-level container in Sentry. Everything lives under an organization: your projects, teams, members, and billing.
The project represents a single codebase or service. Best practice: one project per deployable service, such as frontend-web, api-gateway, or ios-app.
Event is an individual occurrence of a single error instance or performance transaction sent from the SDK to Sentry.
Issue is a group of events that share the same fingerprint (typically the same error message and stack trace). This is Sentry’s most powerful feature: grouping turns 10,000 raw events into a manageable list of distinct problems.
DSN (Data Source Name) is the URL that connects your application to your Sentry project. It tells the SDK where to send error data. You get this from Project Settings → Client Keys.
Breadcrumbs are a chronological trail of events clicks, navigation changes, console logs, network requests that happened in the moments before an error. They are your best tool for reproducing bugs that would otherwise be impossible to recreate.
Environment is a logical tag (production, staging, development) that lets you filter and separate error streams. Never mix staging and production data; it creates alert fatigue and buries real incidents.
Release is a version tag (like v2.4.1 or a commit SHA) linked to a specific deployment. With releases configured correctly, Sentry can tell you exactly which commit introduced a regression.
How Sentry Captures and Processes Errors
Understanding the data flow helps you configure Sentry intelligently rather than just copying setup code.
When an error occurs in your application, here is what happens:
The SDK captures the exception either automatically (uncaught errors, unhandled promise rejections) or via explicit Sentry.captureException(error) calls in your code.
The SDK then enriches the event with everything it knows: the full stack trace, breadcrumbs from recent user activity, user identity (if you’ve set it), browser and OS information, the current URL, request headers, and release version.
This payload is sent over HTTPS to Sentry’s ingest endpoint as a JSON object. Sentry validates it, runs it through the fingerprinting algorithm to determine which Issue it belongs to, and stores it in a ClickHouse columnar database for fast querying.
On your dashboard, you see the issue updated with a new occurrence. If this is the first time this error appears, you get an alert (if you’ve configured one). If it’s a known error spiking suddenly, Sentry can alert you on that too.
The whole pipeline takes seconds.
Setting Up Sentry: Step-by-Step for JavaScript and React
Here is a practical setup walkthrough for the most common use case of a JavaScript frontend application with React.
Step 1: Create a Project
Go to sentry.io, create a free account, and create a new project. Select your platform (React, Vue, Next.js, etc.). Sentry will generate a DSN specific to your project.
Step 2: Install the SDK
npm install @sentry/react
For Next.js specifically:
npm install @sentry/nextjs
Step 3: Initialize Sentry
Initialize Sentry as early as possible in your application entry point before any other code runs.
import * as Sentry from "@sentry/react";
Sentry.init({
dsn: "https://your_key@o0xxxxx.ingest.sentry.io/your_project_id",
environment: process.env.NODE_ENV,
release: "my-app@2.5.0",
// Trace 20% of transactions in production
tracesSampleRate: 0.2,
// Capture 10% of user sessions for Session Replay
replaysSessionSampleRate: 0.1,
// Always capture a replay when an error occurs
replaysOnErrorSampleRate: 1.0,
});
Three config options that matter most here: environment separates production errors from dev noise; release enables regression tracking; tracesSampleRate controls performance monitoring volume; keep it low in high-traffic production to manage costs.
Step 4: Wrap Your App in an Error Boundary
import { ErrorBoundary } from "@sentry/react";
function App() {
return (
<ErrorBoundary fallback={<p>Something went wrong. Please refresh the page.</p>}>
<YourMainComponent />
</ErrorBoundary>
);
}
The Error Boundary catches React rendering errors that would otherwise silently white-screen your users.
Step 5: Add User Context
This is the step most developers skip, and it is one of the most valuable things you can do:
// Call this after the user logs in
Sentry.setUser({
id: user.id,
email: user.email,
username: user.name,
});
// Clear on logout
Sentry.setUser(null);
With user context set, every error in your dashboard shows you exactly which users were affected. This transforms “500 errors occurred” into “27 specific users hit this bug” and you can reach out to them proactively.
The Features That Make Sentry Genuinely Powerful
Performance Monitoring
Sentry tracks more than errors. With performance monitoring enabled, it shows you which pages and API routes are slowest, which database queries are the bottleneck, and where N+1 query problems are hiding in your ORM.
Key metrics Sentry tracks automatically include LCP (Largest Contentful Paint), FCP (First Contentful Paint), and CLS (Cumulative Layout Shift) the Core Web Vitals that directly affect both user experience and search rankings. Slow pages don’t just frustrate users; they cost you SEO ranking and conversion rate. Studies show sites that load in more than 5 seconds lose 37% of their traffic.
Release Tracking and Regression Detection
When you tag each deployment with a release version and upload source maps, Sentry connects errors to the exact commit that introduced them. The Release Health dashboard shows you crash-free session rates per release and a direct KPI for deployment quality.
If a release shows a crash-free rate of 93%, you immediately know that 7% of sessions are experiencing crashes and the current build needs a hotfix before broader rollout.
More importantly, Sentry automatically flags regressions issues that were previously resolved but reappears in a new release. This catches the common mistake where a bug is fixed in one place but reintroduced by a later change.
Session Replay
When you need to understand not just what error occurred but why a user triggered it, Session Replay records a video-like reproduction of what the user was doing. You can watch exactly what happened: the clicks, scrolls, and input changes in the seconds before the crash. This is especially useful for UI bugs that are hard to reproduce from a stack trace alone.
Alerting and Integrations
Sentry integrates natively with Slack, PagerDuty, GitHub, GitLab, Jira, and Linear. You can configure alert rules like: “If this error occurs more than 10 times in 5 minutes in production, post to #incidents in Slack and create a Jira ticket.”
The key to useful alerting is specificity. Don’t alert on every error alert on error spikes, regressions, and issues affecting your highest-value user journeys.
Best Practices From Teams Running Sentry in Production
The difference between a Sentry installation that is genuinely useful and one that becomes background noise comes down to discipline in a few areas.
Filter noise aggressively from the start. Not every error deserves your attention. Browser extension errors, flaky network timeouts from poor user connections, and 4xx validation errors that mean your app is working correctly should all be filtered out. In Sentry.init(), use ignoreErrors and denyUrls to exclude known noise sources:
Sentry.init({
dsn: "...",
ignoreErrors: [
/ResizeObserver loop/,
"Non-Error promise rejection captured",
],
denyUrls: [
/extensions\//i,
/^chrome-extension:\/\//i,
],
});
Report server errors on the backend, not the frontend. When your server returns a 500, it has already sent a full report to Sentry with the complete stack trace. If your frontend also captures “API returned 500,” you get a duplicate issue with no useful context. Handle the UX in your frontend error handler, but let the backend own the error reporting.
Use one project per major service. One giant project for everything creates unmanageable noise and makes it impossible to route alerts to the right team. Separate frontend, backend API, background workers, and mobile apps into individual projects.
Always configure releases. Teams that install Sentry without setting up release tracking get errors but can’t answer the most important question: “Which deploy caused this?” Setting up release tagging in your CI/CD pipeline is the single highest-leverage improvement you can make after the initial SDK integration.
Set up a post-deploy review habit. Sentry becomes truly valuable when someone on your team looks at the Issues page within 30 minutes of every deploy. The combination of release tagging and a short review window means you catch regressions in minutes rather than days.
Add feature flag tags. If you’re doing gradual rollouts with feature flags, tag events with the active flags:
Sentry.setTag("feature_checkout_v2", "enabled");
This lets you isolate errors to specific feature variants instantly during a rollout.
Common Mistakes to Avoid
Mixing production and staging. Always set the environment option and filter to production-only in your alert rules.
Sending sensitive data. Sentry captures request headers, query parameters, and user input. Before going live, audit what you’re sending and use beforeSend to scrub passwords, tokens, and PII:
beforeSend(event) {
if (event.request?.data?.password) {
delete event.request.data.password;
}
return event;
}
Alerting on everything. When every error triggers a Slack notification, teams start ignoring Sentry entirely. Start with zero alerts, watch your Issues page for a week, then add targeted alerts only for issues that are genuinely urgent.
Never resolving issues. Sentry tracks issue state. Mark issues as resolved when you deploy a fix. This enables regression detection and keeps your Issues list from becoming a graveyard.
Sentry Pricing: What You Actually Need
The free tier includes 5,000 errors per month, 10,000 performance transactions, and 50 session replays. For side projects and early-stage products, this is often enough to get started.
The Team plan (approximately $26/month for a team of five) raises the limits to 50,000 errors and 100,000 performance transactions. For most production applications serving real users, this is the right tier. The time saved debugging a single production incident typically pays for several months of Sentry.
Sentry’s pricing is volume-based; you pay for events sent, not for seats. This makes it cost-effective for large teams but means you need to be thoughtful about sampling rates for high-traffic applications.
Sentry vs. The Alternatives
Bugsnag offers a similar error tracking feature set with a pricing model based on monthly active users rather than event volume. It is a strong choice for mobile-heavy teams.
Rollbar is an older Sentry competitor with solid fundamentals but is less commonly chosen for new projects today.
LogRocket focuses primarily on session replay with error tracking as a secondary capability. Choose LogRocket if replay quality is your top priority.
Datadog and New Relic are comprehensive observability platforms that include error tracking alongside infrastructure monitoring, APM, and log management. They are the right choice if you need a single platform for everything, but they come at significantly higher cost and complexity.
For teams with data residency or compliance requirements, Sentry’s self-hosted option and open-source alternatives like GlitchTip (which is Sentry API-compatible) are worth evaluating.
Conclusion: From Passive Dashboard to Active Safety Net
Sentry installed and forgotten is just a dashboard. Sentry integrated into your shipping process with release tagging, filtered alerts, user context, and a post-deploy review habit is a genuine safety net that catches customer-facing bugs in minutes.
The teams that get the most value from Sentry are not the ones with the most sophisticated configuration. They are the ones who built simple, consistent habits around it: tag every deploy, review Issues after every release, filter noise early, and act on regressions immediately.
Start with the basic SDK integration. Add user context. Set up releases in your CI pipeline. Build one alert for production error spikes. Then iterate from there. Done right, Sentry pays for itself the first time it saves you from a 3-hour debugging session that would have otherwise ruined your evening.
Have questions about Sentry configuration for your specific stack? The Sentry documentation at docs.sentry.io is the most up-to-date reference, and the Sentry community on Discord is active and genuinely helpful.