Skip to content

Chore: configure sentry#629

Draft
mashazyu wants to merge 2 commits into
developmentfrom
chore/configure-sentry
Draft

Chore: configure sentry#629
mashazyu wants to merge 2 commits into
developmentfrom
chore/configure-sentry

Conversation

@mashazyu

Copy link
Copy Markdown
Contributor

Add Sentry Error Tracking & Performance Monitoring

Summary

This PR integrates Sentry for comprehensive error tracking and performance monitoring in the application.

Changes

  • Error Tracking: Sentry SDK with React Error Boundary integration
  • Performance Monitoring: React Router v6 navigation tracking
  • Source Maps: Automatic uploads for readable stack traces in production - tbd
  • Version Management: Git tags as single source of truth for releases - tbd

Technical Details

  • Installed @sentry/react (v10.34.0) and @sentry/vite-plugin (v4.6.2)
  • Created src/sentry.js with Sentry initialization and React Router v6 integration
  • Updated vite.config.js to generate and upload source maps automatically
  • Updated ErrorBoundary.jsx to capture React errors to Sentry

Configuration

Requires environment variables:

  • VITE_SENTRY_DSN (required for error tracking)
  • SENTRY_ORG, SENTRY_PROJECT, SENTRY_AUTH_TOKEN (required for source map uploads)

Testing

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 integrates Sentry error tracking and performance monitoring into the application by installing @sentry/react, creating a Sentry initialization module, and updating the ErrorBoundary component to capture React errors.

Changes:

  • Added Sentry SDK configuration with React Router v6 performance tracking
  • Initialized Sentry on application startup
  • Updated ErrorBoundary to send captured errors to Sentry

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/sentry.js New file containing Sentry initialization with environment-based configuration and React Router integration
src/index.jsx Calls initSentry() at application startup
src/components/ErrorBoundary.jsx Enhanced to capture exceptions to Sentry with component stack context
package.json Added @sentry/react dependency (v10.34.0)
README.md Added documentation for required Sentry environment variables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/sentry.js
@@ -0,0 +1,54 @@
import * as Sentry from "@sentry/react";
import { browserTracingIntegration, reactRouterV6BrowserTracingIntegration } from "@sentry/react";

Copilot AI Jan 15, 2026

Copy link

Choose a reason for hiding this comment

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

The browserTracingIntegration is already imported from @sentry/react on line 1 via the namespace import * as Sentry. This redundant import should be removed and the integration should be accessed as Sentry.browserTracingIntegration on line 37.

Copilot uses AI. Check for mistakes.
Comment thread src/sentry.js
Comment on lines +37 to +44
browserTracingIntegration({
routingInstrumentation: reactRouterV6BrowserTracingIntegration({
useLocation,
useNavigationType,
createRoutesFromChildren,
matchRoutes,
}),
}),

Copilot AI Jan 15, 2026

Copy link

Choose a reason for hiding this comment

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

Incorrect Sentry integration API usage. reactRouterV6BrowserTracingIntegration should be used as a standalone integration, not as the routingInstrumentation parameter to browserTracingIntegration. The correct usage is to pass reactRouterV6BrowserTracingIntegration with the router hooks directly in the integrations array, replacing the browserTracingIntegration wrapper entirely.

Copilot uses AI. Check for mistakes.
Comment thread src/sentry.js
@@ -0,0 +1,54 @@
import * as Sentry from "@sentry/react";
import { browserTracingIntegration, reactRouterV6BrowserTracingIntegration } from "@sentry/react";

Copilot AI Jan 15, 2026

Copy link

Choose a reason for hiding this comment

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

Since browserTracingIntegration is already available through the namespace import on line 1, this named import creates redundancy. Remove the named import and use Sentry.reactRouterV6BrowserTracingIntegration instead for consistency.

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