Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Sentry integration to version 10, refactoring the initialization approach and adding new monitoring capabilities. The changes move from conditional runtime initialization to a preload pattern using Node's --import flag, and add comprehensive example routes for testing Sentry functionality.
Key Changes:
- Upgraded Sentry packages from v9 to v10 and restructured initialization to use instrument files
- Removed conditional Sentry initialization logic and adopted a preload approach with
--importflag - Added example routes (
/sentry/example-pageand/sentry/api/sentry-example-api) for testing Sentry integration
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Simplified Sentry configuration, removing auth/org/project settings and sourcemap upload options |
| server/utils/monitoring.ts | Deleted file - initialization moved to instrument.server.ts |
| server/index.ts | Removed conditional Sentry initialization and SENTRY_ENABLED logic |
| instrument.server.ts | New file containing server-side Sentry initialization with spotlight support |
| app/entry.server.tsx | Integrated Sentry request/error handlers and added CSP for Spotlight |
| app/entry.client.tsx | Moved client Sentry initialization inline with spotlight support |
| app/utils/monitoring.client.tsx | Deleted file - initialization moved to entry.client.tsx |
| app/routes/sentry/example-page.tsx | New example page for testing Sentry error capture |
| app/routes/sentry/api.sentry-example-api.ts | New API route for testing backend error capture |
| package.json | Updated dev/start scripts to use --import flag and upgraded Sentry packages |
| playwright.config.ts | Added SENTRY_ENVIRONMENT test configuration |
| other/Dockerfile | Added SENTRY_RELEASE environment variable from build arg |
| .github/workflows/deploy.yml | Added Sentry environment configuration and release creation step |
| docs/monitoring.md | Updated documentation to reflect new deployment workflow |
| .env.example | Added SENTRY_ENVIRONMENT configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -70,19 +69,9 @@ export default defineConfig((config) => ({ | |||
| })) | |||
|
|
|||
| const sentryConfig: SentryReactRouterBuildOptions = { | |||
There was a problem hiding this comment.
The reactComponentAnnotation configuration is introduced without explanation. Consider adding a comment explaining what this feature does and why it's enabled.
| const sentryConfig: SentryReactRouterBuildOptions = { | |
| const sentryConfig: SentryReactRouterBuildOptions = { | |
| // Enable Sentry's React component annotations so component names and render trees | |
| // are visible in performance traces and error reports, improving production debugging. |
|
|
||
| - name: Create Sentry release | ||
| env: | ||
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} |
There was a problem hiding this comment.
These commented-out values are required for the Sentry release action to work. The documentation should clarify that users must uncomment and set these values, or the step will fail silently.
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| # NOTE: Uncomment and set the following values, or this Sentry release step will not work. |
| /\/site\.webmanifest/, | ||
| ], | ||
| integrations: [ | ||
| Sentry.prismaIntegration(), |
There was a problem hiding this comment.
The prismaIntegration() is called without the prismaInstrumentation parameter that was present in the old configuration (server/utils/monitoring.ts). Verify this is intentional and that Prisma instrumentation still works correctly without explicitly passing PrismaInstrumentation.
Test Plan
Checklist
Screenshots