Русский flag Русский

How to catch errors in production: setting up monitoring in 15 minutes

Published on 2025-11-20

You deployed a new feature. Everything works perfectly on your local machine, and you’re happy with the result.
Then a message appears: “Nothing works for me.” You open the server logs — they’re empty. It turns out the error happened on the client side, from a user with an old browser version or unusual settings. And you might never have known about it.

This happens to almost everyone who deploys projects to production. It happened to me too, until I set up a tool that lets me see errors almost instantly — even if it’s the middle of the night and the problem occurred for a single user on the other side of the world.

That tool is Sentry. In this article I’ll show how to connect Sentry to your project in fifteen minutes.


Why Sentry

Imagine a CCTV system. While there are no cameras — you don’t know what’s happening in the room. Once they appear, the situation changes completely: everything is under control.

Sentry works on the same principle, but for your application. It records errors, warnings, and anomalous behavior so you learn about issues before your users do.

What Sentry gives you:

  • Instant notifications: you learn about errors right away — in Telegram, Slack, email, or another channel.
  • Detailed context: Sentry shows which user experienced the error, on which device, and under what conditions.
  • Stack trace: the exact place in the code where everything crashed.
  • Breadcrumbs: the sequence of events that led to the failure.
  • Prioritization: you understand whether one person or hundreds are affected.

For personal projects and startups it’s especially nice that Sentry has a very generous free plan.


How to connect Sentry: step-by-step guide

Step 1. Sign up

Go to https://sentry.io and create an account. You can use GitHub or Google to speed up the process.
During signup choose the main language of your application. Other languages and platforms can be added later.

Step 2. Create a project

Click the Create Project button.
Choose your platform: Node.js, Python, Django, React, Next.js, Go, PHP — whatever.
Give the project a clear name, for example:


my-awesome-app

After that Sentry will generate a DSN for you — a unique address where the app will send error reports. It looks like this:


https://12345abc@o123456.ingest.sentry.io/1234567

Save this address — you’ll need it in a minute.


Step 3. Integrate Sentry into the code

Below are instructions for popular technologies. Sentry will automatically offer ready-made examples for the selected platform.

JavaScript / React / Next.js

Install dependencies:

npm install @sentry/browser @sentry/tracing

Initialize Sentry in your entry point (for example, index.js, _app.js):

import * as Sentry from "@sentry/browser";

Sentry.init({
  dsn: "ВАШ_DSN_ОТСЮДА",
  release: "my-awesome-app@1.0.0",
  tracesSampleRate: 1.0
});

Python (Django / Flask / FastAPI)

Install:

pip install sentry-sdk

Initialize:

import sentry_sdk

sentry_sdk.init(
    dsn="ВАШ_DSN_ОТСЮДА",
    traces_sample_rate=1.0,
    release="1.0.0",
)

Step 4. Verify it’s working

Add a temporary test error call:

throw new Error("Test Sentry Error");

Run the application, open the relevant page, then go to the Sentry dashboard.
Within ten to thirty seconds a new error will appear — everything is working as expected.


Step 5. Configure alerts

Go to: Settings → Alerts → Create Alert

Choose the alert condition, for example:

  • every new error,
  • increase in error rate,
  • errors for a specific release version.

Choose the delivery channel: Telegram, Slack, Microsoft Teams, Email or Webhook.


Step 6. How to track releases (bonus)

Release tracking lets you see which version contains the error, how many users are affected, and when the issue first appeared.

The simplest way is the official CLI:

curl -sL https://sentry.io/get-cli/ | bash
sentry-cli releases new $VERSION
sentry-cli releases finalize $VERSION

I recommend integrating this into CI/CD so it happens automatically.


How much Sentry costs (as of November 2025)

Free plan — Developer Plan

  • 5,000 errors per month
  • 5,000,000 spans for performance monitoring

This is more than enough for most pet projects and MVPs.

From $26 per month with annual billing.
Choose this when limits become tight or advanced features are required.


Summary

Connecting Sentry is one of the fastest ways to improve product quality. You:

  1. Sign up for the service.
  2. Add a few lines of code.
  3. Gain control over production.

You stop being afraid of messages from users like “nothing works for me”, because now you learn about problems first — and fix them before anyone gets upset.

Related reviews

Need help?

Get in touch with me and I'll help solve the problem

Related Posts