Error Tracking & Monitoring

Production Error Tracking: A Complete Guide

Production error tracking is more than a try/catch and a log line. Learn the pipeline — capture, group, enrich, alert, triage — and what to set up first.

In development, you can reproduce almost any error — attach a debugger, step through the code, watch the variables change. Production is different. Your users see the error; you don't. You can't reproduce it, can't step through, and the user has already closed the tab. Production error tracking is how you bridge that gap: a complete system to automatically capture, contextualize, alert on, and fix errors after they've already reached real users.

This guide walks you through the entire production pipeline: from capturing the first error to verifying the fix. If you're setting up error tracking for a production system for the first time, or moving beyond a basic dashboard-and-hope setup, this is where to start. For the conceptual foundation (what error tracking is and why it matters), see what is error tracking.

1. Capture: Set up global handlers

Before you can track an error, you have to catch it. Most errors in production are never wrapped in try/catch — they're uncaught exceptions or unhandled promise rejections that your runtime would otherwise log to stdout and lose.

The solution is a global error handler, installed once at startup. Every error tracker ships an SDK that does this for you. For JavaScript:

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

Sentry.init({
  dsn: "https://<key>@light-trace.robomiri.com/1",
  environment: "production",
  release: "web@2.1.0",
  tracesSampleRate: 0.1,
});

That single call installs handlers for:

  • Browser uncaught exceptions (window.onerror), so a thrown TypeError doesn't just crash the page silently.
  • Unhandled promise rejections (unhandledrejection), so a failed API call in a background fetch doesn't disappear.
  • Framework errors (React error boundaries, Vue error handlers, Angular interceptors) if you're using the framework SDK.

Node.js is similar:

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

Sentry.init({
  dsn: "https://<key>@light-trace.robomiri.com/1",
  environment: "production",
  release: "api@2.1.0",
});

// Sentry now catches uncaughtException and unhandledRejection

What you'll miss without this: Errors that never reach your logs. A race condition that crashes one user's session per week. A third-party script that throws and silently dies. A job queue that processes 1,000 tasks and loses the 50 that error out. These errors become invisible — no customer reports them, no log aggregator sees them, and you ship the next release with the same bug.

Install the error tracker in your app's bootstrap, before any other code runs. If you initialize after your main code, you'll miss errors in that initialization path.

2. Group: Fingerprint errors into issues

Capture without grouping is just noise. Ten thousand identical "Request timeout" errors, one per user, becomes 10,000 issues on your dashboard. No one looks at that list.

Error grouping collapses identical errors into a single issue using a fingerprint — a stable hash of the error's root cause. By default, most error trackers fingerprint by exception type and stack trace, which works well:

  • TypeError: Cannot read properties of undefined at processPayment (payment.js:42) — every identical stack frame hashes to the same issue.
  • When the code changes and the line number shifts, the fingerprint updates and creates a new issue.

But not all errors are identical in the way that matters. A timeout from a slow third-party API is one problem; the same timeout code thrown from your database is a different problem. Custom fingerprinting lets you group by what matters:

Sentry.init({
  beforeSend: (event) => {
    if (event.exception?.[0]?.value?.includes?.("timeout")) {
      event.fingerprint = ["timeout", event.request?.url];
    }
    return event;
  },
});

Now every timeout to the same endpoint groups together, even if line numbers shift.

What you'll miss: Hundreds of "duplicate" issues that are actually the same bug. Notification fatigue. Triage taking three times longer because you're chasing the same error across 200 GitHub issues.

3. Enrich: Add context to every error

A stack trace tells you where the code broke. Context tells you why. Without it, you're debugging blind.

Start with the essentials:

  • Release version — which deploy introduced this? Did it regress on the last push?
  • Environment — is this hitting production, staging, or both?
  • Affected user — how many people does this touch? Do they have a pattern (same browser, same region)?
  • Breadcrumbs — what happened just before the crash? API calls, state changes, user actions.
  • Source maps — if your JavaScript is minified, the stack trace is useless. Upload source maps so the trace points to real line numbers.

Example enrichment:

Sentry.setUser({
  id: user.id,
  email: user.email,
  plan: user.tier,
});

Sentry.addBreadcrumb({
  category: "checkout",
  message: "Payment initiated",
  level: "info",
  data: { amount_cents: 9999, currency: "USD" },
});

Sentry.captureException(new Error("Payment API returned 503"));

The resulting error now carries: who was affected, what they were doing, what the error was, and what their plan tier is. You can instantly reproduce the flow that broke.

What you'll miss: Errors with no context are bug reports with no repro steps. Stack traces that point to minified variable names. Hours spent asking customers "which browser? which OS? what were you doing when it happened?" instead of reading it from the error itself.

4. Alert: Know about errors in real time

Not every error deserves a page. You don't need an alert for one 404 on a legacy endpoint. You do need one the moment a brand-new error appears, or when an error that usually affects 5 users suddenly affects 500.

Configure two alert rules:

  1. New-issue rule: Page/email immediately when a new issue appears for the first time.
  2. Frequency rule: Page when an existing issue's event count exceeds a threshold you set based on your service's baseline.
New issue alert: "Send email"
Frequency alert: "If error events > 50 in 1 hour, send email"

LightTrace delivers alerts by email. Keep alert rules small and high-signal. A rule that fires every hour is a rule your team will ignore.

Alert on error rate or percentile impact, not raw volume. A 500-request-per-second endpoint throwing one error per 10,000 requests is a 0.01% error rate — probably not actionable. The same endpoint with one error per 100 requests is a 1% error rate — investigate.

What you'll miss: Errors discovered days or weeks later when a customer complains. High-noise alerts that the team starts ignoring. Silent regressions in less-common features.

5. Triage: Sort by impact, assign ownership

An alert reached you. Now what?

Triage means asking three questions:

  1. Is this real, or noise (expected 404, bot traffic, extension errors)?
  2. How many users does it affect? How many events?
  3. Who owns it, and how urgent is it?

Spend five minutes a day on triage. For each new issue:

  • Mark it as noise if it's a 404 from a crawler, a ResizeObserver loop, or a known third-party script error. Don't clutter your inbox.
  • Tag it with the affected team (@backend, @frontend, @payments).
  • Estimate severity: critical (users blocked), high (feature broken), low (edge case).

An issue without a triage decision is an issue that sits unresolved for weeks.

6. Fix and verify

Once fixed, deploy the new release. Mark the issue as resolved in your error tracker with the release tag:

Issue #4201: TypeError in checkout
Status: Resolved in release web@2.1.1

Then verify it stayed fixed. Most error trackers offer release health metrics — the percentage of sessions crash-free since a release shipped. If version 2.1.1 shows 99.8% crash-free for the affected code path, the fix worked. If it drops to 98%, the error regressed.

What you'll miss: Fixes that you think worked but didn't. Errors that regress silently two releases later. No way to measure the impact of your fixes.

End-to-end pipeline

Here's what each stage configures and what fails if you skip it:

StageWhat to configureFailure if skipped
CaptureGlobal error handlers via SDK initErrors never reported; silent failures
GroupFingerprinting rules, release tags10,000 issues instead of 10; noise
EnrichUser context, breadcrumbs, source mapsStack traces point to minified garbage; can't reproduce
AlertNew-issue + frequency thresholdsErrors discovered weeks later by customers
TriageWeekly review; ownership assignmentDuplication; unclear priorities
Fix + verifyRelease tagging; crash-free rate trackingCan't tell if fix actually worked

What to keep out: PII and noise

Scrub personally identifiable information. By default, error trackers capture request bodies and headers, which might include passwords, API keys, credit card numbers, or email addresses. LightTrace includes sensitive-data scrubbing — configure it to mask passwords, credit card patterns, and any custom fields:

Sentry.init({
  integrations: [
    Sentry.replayIntegration({ maskAllText: true }),
  ],
});

Mute predictable noise. Some errors are expected and actionable, others are just volume:

  • 404s on known legacy endpoints — expected, not a bug.
  • Bot traffic — crawlers and security scanners throw errors all day.
  • Browser-extension errorsResizeObserver loop limit exceeded, Extension context invalidated. Real, but not your bug.
  • Third-party scripts — ad networks, analytics, chat widgets throw their own errors.

Configure filters to exclude these from your issue count. You'll still see them if you search, but they won't trigger alerts or pollute your metrics.

Getting started

  1. Install the SDK for your language (Node, React, Python, etc.). LightTrace is Sentry-SDK-compatible — change only the dsn.
  2. Add release and environment tags at init so you can correlate errors to deploys.
  3. Upload source maps so stack traces point to real code.
  4. Set one new-issue alert to email the team.
  5. Spend five minutes a day triaging for the first week. Refine fingerprinting and noise filters based on what you see.

The pipeline seems complex on paper. In practice, it's a routine: errors land, you triage them, fix them, and measure that your fix holds. After a week, it becomes automatic. After a month, you stop finding errors in production by customer complaints.

Start tracking errors in minutes

Point any Sentry SDK at LightTrace and deploy a production error tracking pipeline in under 10 minutes.

Production errors won't go away. But the system that responds to them can be as fast and reliable as your deploy pipeline.

Fix your next production error faster

Point any Sentry SDK at LightTrace — free up to 5,000 events/month.