docs(suspensive.org): add Sentry error monitoring - #1977
Conversation
Integrate @sentry/nextjs to monitor the docs site's health: - Capture client, server, and edge runtime errors via instrumentation files and a global-error boundary - Record Web Vitals (performance) through Sentry browser tracing - Wire Suspensive's own <ErrorBoundary onError> to Sentry.captureReactException - Tunnel events through /monitoring to dodge ad blockers, and exclude that path from the i18n proxy matcher - Sample 100% in dev / 10% in production to stay within quota Sentry stays disabled until NEXT_PUBLIC_SENTRY_DSN is set, so local builds and PRs are unaffected.
People can be co-author:
|
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1977 +/- ##
=======================================
Coverage 93.22% 93.22%
=======================================
Files 42 42
Lines 664 664
Branches 164 163 -1
=======================================
Hits 619 619
Misses 42 42
Partials 3 3
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Integrates Sentry error/performance monitoring into the docs/suspensive.org Next.js (Nextra) site, adding runtime-specific Sentry initialization, a global App Router error boundary, and a tunneled ingest route to improve reliability of client-side reporting.
Changes:
- Add
@sentry/nextjsand configure Sentry source map upload + tunneling viawithSentryConfiginnext.config.mjs. - Introduce Next.js instrumentation entrypoints for server/edge/client runtimes and add a global App Router error boundary.
- Wire Suspensive
<ErrorBoundary onError>in key client components toSentry.captureReactExceptionand exclude/monitoringfrom the i18n proxy matcher.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds Sentry and related transitive dependencies to the lockfile. |
| docs/suspensive.org/package.json | Adds @sentry/nextjs dependency for the docs site. |
| docs/suspensive.org/next.config.mjs | Wraps Nextra config with withSentryConfig, enabling source map upload + /monitoring tunnel. |
| docs/suspensive.org/src/proxy.ts | Excludes /monitoring from the i18n proxy matcher to avoid redirecting Sentry tunnel traffic. |
| docs/suspensive.org/src/instrumentation.ts | Adds runtime-based registration of Sentry configs and forwards request errors. |
| docs/suspensive.org/src/instrumentation-client.ts | Initializes client-side Sentry and hooks router transitions. |
| docs/suspensive.org/src/sentry.server.config.ts | Initializes server-side Sentry settings for Node runtime. |
| docs/suspensive.org/src/sentry.edge.config.ts | Initializes edge-runtime Sentry settings. |
| docs/suspensive.org/src/components/TrustedBy.tsx | Reports Suspensive ErrorBoundary errors to Sentry. |
| docs/suspensive.org/src/components/BubbleChart.tsx | Reports Suspensive ErrorBoundary errors to Sentry in the bubble chart. |
| docs/suspensive.org/src/app/global-error.tsx | Adds App Router global error boundary that reports to Sentry. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| integrations: [ | ||
| Sentry.consoleLoggingIntegration({ levels: ['log', 'warn', 'error'] }), | ||
| ], |
| // Attach local variable values to server stack frames for easier debugging. | ||
| includeLocalVariables: true, |
| import * as Sentry from '@sentry/nextjs' | ||
| import NextError from 'next/error' | ||
| import { useEffect } from 'react' | ||
|
|
||
| export default function GlobalError({ | ||
| error, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| }) { | ||
| useEffect(() => { | ||
| Sentry.captureException(error) | ||
| }, [error]) |
|
Size Change: 0 B Total Size: 60.4 kB ℹ️ View Unchanged
|
Integrate @sentry/nextjs to monitor the docs site's health:
Sentry stays disabled until NEXT_PUBLIC_SENTRY_DSN is set, so local builds and PRs are unaffected.
Overview
PR Checklist