Skip to content

Conversation

@kasperpeulen
Copy link
Owner

Test Plan

Checklist

  • Tests updated
  • Docs updated

Screenshots

Copilot AI review requested due to automatic review settings December 29, 2025 13:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --import flag
  • Added example routes (/sentry/example-page and /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.

},
}))

const sentryConfig: SentryReactRouterBuildOptions = {
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reactComponentAnnotation configuration is introduced without explanation. Consider adding a comment explaining what this feature does and why it's enabled.

Suggested change
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.

Copilot uses AI. Check for mistakes.

- name: Create Sentry release
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
/\/site\.webmanifest/,
],
integrations: [
Sentry.prismaIntegration(),
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants