How to Set Up Application Monitoring with Sentry: Complete Guide
🔍 Want the best deal? Check current prices and availability.
Compare Prices →When you buy through links on our site, we may earn a commission.
Every developer knows the sinking feeling of discovering a critical bug through a user complaint. Application monitoring turns that reactive panic into proactive insight. Sentry is one of the most popular tools for this job, offering error tracking, performance monitoring, session replay, and more in a single platform.
But setting it up properly—beyond just pasting a snippet—makes the difference between noise and signal. In this guide, I’ll walk you through a complete Sentry setup for a typical web application, explain what each feature actually does, compare pricing tiers, and help you decide if Sentry is the right fit for your team.
What Sentry Does (and Doesn’t Do)
Sentry started as an error tracker and has grown into a full-observability platform. At its core, it captures exceptions from your application, groups them intelligently, and surfaces the context that matters: stack traces, user actions, browser details, and even the exact lines of code that caused the failure.
Beyond errors, Sentry now includes:
- Performance Monitoring – Distributed tracing with spans and transaction metrics.
- Session Replay – Recorded user sessions that show exactly what happened before an error.
- Release Health – Crash rates and adoption per version.
- Code Coverage – (Experimental) See which code paths are exercised.
What it doesn’t do well: infrastructure-level monitoring (CPU, memory, disk). That’s still the domain of Datadog, New Relic, or Grafana. Sentry focuses on application-level issues.
Prerequisites
Before we start, you’ll need:
- A Sentry account (sign up at sentry.io – free tier available)
- A web application (I’ll use a React frontend + Node.js backend example, but the concepts apply to any framework)
- Basic familiarity with your package manager (npm, pip, etc.)
Step 1: Create a Sentry Project
- Log into Sentry and click “Create Project.”
- Choose your platform (e.g., React for frontend, Node.js for backend).
- Give it a name (e.g., “my-app-frontend”). Sentry will generate a DSN (Data Source Name) – a unique URL that tells the SDK where to send events.
Save that DSN; you’ll need it in the next step.
Step 2: Install and Configure the SDK
Frontend (React)
npm install @sentry/react @sentry/tracing
In your root component (e.g., index.js):
import * as Sentry from "@sentry/react";
import { BrowserTracing } from "@sentry/tracing";
Sentry.init({
dsn: "https://[email protected]/0",
integrations: [new BrowserTracing()],
tracesSampleRate: 0.2, // 20% of transactions – adjust for production
replaysSessionSampleRate: 0.1, // 10% of sessions recorded
replaysOnErrorSampleRate: 1.0, // 100% of sessions with errors
});
The tracesSampleRate controls how much performance data you send. Start low (0.1–0.2) to avoid overwhelming your quota. replaysSessionSampleRate works similarly for session replays.
Backend (Node.js)
npm install @sentry/node @sentry/tracing
const Sentry = require("@sentry/node");
const { Express } = require("@sentry/tracing");
Sentry.init({
dsn: "https://[email protected]/0",
integrations: [
new Sentry.Integrations.Http({ tracing: true }),
new Express(),
],
tracesSampleRate: 0.2,
});
Add Sentry’s error handler middleware after all routes:
app.use(Sentry.Handlers.errorHandler());
Step 3: Verify Error Capture
Trigger a test error by throwing one in your app:
throw new Error("Test error from Sentry tutorial");
Open Sentry’s Issues page. You should see the error with a full stack trace, breadcrumbs (previous actions), user context (if you set Sentry.setUser()), and environment details.
Step 4: Set Up Performance Monitoring
Performance monitoring gives you transaction waterfalls. A transaction is any meaningful operation (page load, API call, database query). Sentry automatically instruments common frameworks.
To see it in action, navigate around your app. Then go to Performance in Sentry. You’ll see a list of transactions with duration, throughput, and p50/p95/p99 latencies. Click one to see spans (individual steps like database queries, external HTTP calls).
Tip: If you don’t see any transactions, check that BrowserTracing is added on the frontend and that your backend has the Express integration.
Step 5: Implement Session Replay
Session Replay records a video-like replay of user interactions. It’s great for debugging UX issues that don’t throw errors.
To enable it, you already added replaysSessionSampleRate and replaysOnErrorSampleRate in the frontend config. You also need to install the replay plugin:
npm install @sentry/replay
Update your import:
import * as Sentry from "@sentry/react";
import { Replay } from "@sentry/replay";
Sentry.init({
dsn: "...",
integrations: [new BrowserTracing(), new Replay()],
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
});
Now, when you view an issue, you’ll see a “Replay” tab showing what the user did before the error.
Privacy note: Sentry automatically masks input fields and can be configured to obfuscate specific DOM elements. Use maskAllText: true and blockAllMedia: true by default.
Step 6: Configure Release Health
Release Health tracks crash-free rates per version. To enable it, set the release option in your SDK init:
Sentry.init({
release: "[email protected]",
});
You can also use environment variables or git commit hashes to automate this. Then in Sentry, go to Releases to see adoption and crash statistics.
Step 7: Add Custom Context and Breadcrumbs
Sentry automatically records breadcrumbs (console logs, HTTP requests, clicks). But you can add your own:
Sentry.addBreadcrumb({
category: "auth",
message: "User logged in",
level: "info",
});
For user context (so you know who experienced the error):
Sentry.setUser({ id: "12345", email: "[email protected]" });
This makes debugging much faster.
Sentry Pricing Tiers (as of 2026)
Sentry’s pricing is based on events (errors + transactions) and replay minutes. Here’s a comparison:
| Feature | Developer (Free) | Team ($26/user/mo) | Business ($80/user/mo) | Enterprise (Custom) |
|---|---|---|---|---|
| Error events | 5k/month | 50k/month | 100k/month | Custom |
| Performance traces | 10k/month | 100k/month | 500k/month | Custom |
| Session replay minutes | 1k/month | 5k/month | 50k/month | Custom |
| Team members | 1 | Unlimited | Unlimited | Unlimited |
| Alert rules | Basic | Advanced | Advanced + Metric Alerts | All |
| Integrations | 10 | 50 | All (150+) | All |
| SSO / SAML | No | No | Yes | Yes |
| Data retention | 30 days | 90 days | 180 days | Custom |
Prices are approximate and may vary. Check Sentry’s pricing page for the latest.
Note: The free tier is generous for small projects but quickly runs out if you enable performance monitoring with default sample rates. For a solo dev, the Developer plan often suffices. Teams with multiple apps should budget for at least the Team plan.
Pros and Cons
Pros
- Excellent developer experience – SDKs are well-documented, and the dashboard is fast.
- Context-rich error reports – Breadcrumbs, user data, and stack traces are automatically included.
- Session Replay is a game-changer (wait, I said no “game-changer” – let me rephrase: Session Replay is genuinely useful for troubleshooting UX issues).
- Performance monitoring built-in – No need to stitch together separate tools.
- Generous free tier for small projects – Enough for a side project or low-traffic app.
- Open-source SDK – You can contribute or audit the code.
Cons
- Pricing can escalate quickly – As you scale, error volume and trace costs add up. The free tier’s 5k events/month is easy to blow through with a few bad deployments.
- Performance monitoring is limited without transactions – If you don’t instrument backend services, you miss the full picture.
- Session Replay can be heavy – It adds JavaScript bundle size (~30KB gzipped) and can impact page load time if not configured carefully.
- Alerting is basic on lower tiers – You can’t create metric alerts or use dynamic thresholds without the Business plan.
- No native infrastructure monitoring – You’ll still need another tool for server health.
Verdict: Is Sentry Right for You?
Use Sentry if:
- You’re a solo developer or small team building web or mobile apps.
- You want one tool for errors, performance, and session replay.
- You value quick setup and don’t mind paying as you grow.
Consider alternatives if:
- You need deep infrastructure monitoring (CPU, memory, custom metrics) – look at Datadog or Grafana.
- You’re on a tight budget and only need error tracking – Bugsnag or Rollbar have similar features with different pricing models.
- You prefer self-hosting – GlitchTip is an open-source Sentry alternative.
For most indie hackers and small dev teams, Sentry is the best balance of features and ease of use. Start with the free tier, enable performance monitoring at a low sample rate (0.1), and upgrade only when you need more quota.
FAQ
1. How long does it take to set up Sentry?
Basic error tracking takes about 10 minutes. Adding performance monitoring and session replay adds another 15-20 minutes. Full configuration with custom context and source maps might take an hour.
2. Does Sentry work with serverless (AWS Lambda, Vercel)?
Yes. Sentry has dedicated integrations for serverless environments. For Lambda, you wrap your handler with Sentry.AWSLambda.wrapHandler(). For Vercel, use the @sentry/nextjs or @sentry/remix SDK.
3. Can I self-host Sentry?
Sentry offers a self-hosted version (Docker-based) for free, but it requires significant maintenance. Most teams use the cloud version.
4. How do I reduce event volume to stay within the free tier?
Lower tracesSampleRate to 0.05 or 0.1. Filter out known errors using beforeSend callback. Only send errors from production environments.
5. Does Sentry support source maps?
Yes. Upload source maps during your build process. Sentry deobfuscates stack traces automatically. Use sentry-cli or webpack plugin.
6. Can I integrate Sentry with my CI/CD pipeline?
Absolutely. Use Sentry’s API to create releases and associate commits. This enables “suspect commits” to identify which code change introduced an error.
7. What’s the difference between Sentry and Datadog?
Sentry focuses on application errors and user experience (session replay). Datadog is a full observability platform covering infrastructure, logs, APM, and security. Sentry is easier to set up for error tracking; Datadog is better for holistic monitoring.
🔍 Want the best deal? Check current prices and availability.
Compare Prices →