Uncaught exceptions that silently swallow stack traces (CWE-209, CWE-215) make production failures invisible until users complain. Without error tracking (Sentry, Datadog, Rollbar), you cannot quantify your application's error rate, identify the most impactful failures, or detect regressions introduced by a deployment. NIST SI-4 requires active system monitoring; ISO 25010 reliability.fault-tolerance requires that faults be detected and surfaced. A single untracked 500 error affecting 10% of checkout requests can silently drain revenue for days.
High because untracked production exceptions mean teams are blind to user-impacting failures until the error rate is high enough for users to notice and report.
Integrate Sentry into your Next.js application using the official SDK.
npm install @sentry/nextjs
Create sentry.client.config.js and sentry.server.config.js:
// sentry.client.config.js
import * as Sentry from '@sentry/nextjs';
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV,
tracesSampleRate: 0.1, // adjust for traffic volume
});
Wire it into next.config.js via withSentryConfig. In the Sentry dashboard, configure an alert rule: trigger when error rate exceeds 5% over 5 minutes, notify #incidents in Slack and page the on-call engineer via PagerDuty for P1-class errors.
ID: deployment-readiness.monitoring-alerting.error-tracking
Severity: high
What to look for: Enumerate every relevant item. Check for error tracking package in dependencies: @sentry/node, @sentry/react, @datadog/browser-logs, newrelic, bugsnag, rollbar. Check for initialization code in app entry point or API handlers. Verify error tracking service is configured for production environment.
Pass criteria: At least 1 of the following conditions is met. An error tracking service (Sentry, Datadog, New Relic, Rollbar, etc.) is integrated, initialized in production, and receives uncaught exceptions. Critical error alerts are configured to notify the team (Slack, email, PagerDuty).
Fail criteria: No error tracking service is integrated, or service is initialized but not receiving errors, or no alerting is configured.
Skip (N/A) when: The project is not planned for production, or has no external dependencies that could fail.
Detail on fail: "No error tracking package found in dependencies." or "@sentry/react installed but not initialized in the application." or "Error tracking configured but no alerts are configured for critical errors."
Remediation: Integrate Sentry (free tier available). For Next.js:
npm install @sentry/nextjs
Then create sentry.client.config.js and sentry.server.config.js:
// sentry.client.config.js
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV,
tracesSampleRate: 1.0,
});
In next.config.js:
const withSentry = require("@sentry/nextjs/withSentry");
module.exports = withSentry({
// ... rest of config
});
Then configure alerts in Sentry dashboard to notify your team on critical errors.