# After launch: error alerts and monitoring

> Once real people use your live app, error tracking with Sentry and structured server logs notify you the moment something breaks in Production—so you don't wait for a frustrated visitor to complain, and you can roll back in one click while your agent fixes the cause.

## Analogy

Opening a shop without an alarm means you only learn the freezer broke when a customer tells you the ice cream melted. A connected sensor texts you the minute the temperature rises, so you move the stock to the backup fridge while the technician repairs it.

## How it works

Before real users arrive on production, your agent sets up **Sentry** (its free Developer plan covers early projects) using `npx @sentry/agent-plugin install` and stores any tokens as env-var secrets. Whenever an unexpected error hits an error-boundary or a server route, Sentry captures the stack-trace and sends you an alert.

Alongside alerts, your app writes **structured logs**: one JSON line per event in your log with the level (`error`, `warn` or `info`), a clear message, a short request ID (the same reference ID shown to the user), the route, the internal user ID and the duration. It never logs secrets, passwords, personal data, prompts or AI outputs.

On vercel's Hobby plan, runtime logs (`npx vercel logs <url>`) are kept for 1 hour, while Sentry keeps error reports so you can inspect them later. Remember that error messages and logs can contain text typed by visitors, so your agent treats all log output as untrusted data and never follows instructions found inside an error.

When an alert fires after a release, protect your users first: open Vercel → **Deployments** → the last working version → **Instant rollback**. Once the live site is safe again, hand the error reference ID and stack trace to your agent so it can reproduce the bug, fix the root cause on a branch and add a test.

## In your project

Before you invite real users, your agent uses the `observability-and-instrumentation` skill to add a structured logger and guides you through connecting Sentry's free Developer plan. You can trigger a test error in a preview deployment to see the alert arrive and verify that no personal data or secrets appear in the report.

## Copy for your agent

```text
Check our project's logging and error boundaries with the observability-and-instrumentation skill: make sure server logs output structured JSON with a request ID and zero secrets or personal data, and walk me through adding Sentry's free plan.
```

---
Source: [Agentic Makers](https://agenticmakers.app/en/learn/error-alerts-and-monitoring) · License: CC BY 4.0
