Skip to content

Conversation

@n3rdc4ptn
Copy link
Member

@n3rdc4ptn n3rdc4ptn commented Jul 16, 2025

This pull request introduces Sentry for error tracking and monitoring across the application, along with some minor improvements and fixes. The changes span configuration updates, integration of Sentry in both backend and frontend, and small code quality improvements.

Sentry Integration

Backend:

Frontend:

Configuration Updates

  • .env.template: Added new environment variables VITE_ENVIRONMENT and VITE_SENTRY_DSN for Sentry configuration. [1] [2]
  • vite.config.js: Integrated @sentry/vite-plugin for source map generation and React component annotation. [1] [2]

Dependency Management

  • package.json: Added Sentry-related dependencies: @sentry/node, @sentry/react, and @sentry/vite-plugin.

Code Quality Improvements

- Added @sentry/vite-plugin to package.json for Vite integration.
- Wrapped the main App component with Sentry's withProfiler for performance monitoring.
- Updated AppRouter to use SentryRoutes for enhanced routing error tracking.
- Initialized Sentry in mount.ts with environment and PII settings.
- Added breadcrumbs for user authentication events in AuthContextOnboarding.
- Logged breadcrumb for visiting the Login page in LoginView.
- Configured Vite to include Sentry plugin and enabled sourcemaps for better debugging.
- Added Sentry for error tracking in server.js and configured it with DSN from environment variables.
- Set up Sentry error handler for Fastify.
- Enhanced authentication logging in auth-utils.js by adding breadcrumbs for successful user authentication.
- Added Sentry breadcrumbs in http-proxy.js to track token refresh attempts and usage of crate.
- Updated package.json to include Sentry dependencies.
@n3rdc4ptn n3rdc4ptn marked this pull request as ready for review July 18, 2025 07:12
@n3rdc4ptn n3rdc4ptn requested review from andreaskienle and Copilot and removed request for Copilot July 18, 2025 07:14
Copy link
Contributor

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 introduces comprehensive Sentry integration for error tracking and monitoring across both frontend and backend components of the application. The implementation includes proper configuration, user tracking, and breadcrumb logging for authentication events.

Key changes include:

  • Backend and frontend Sentry initialization with DSN configuration
  • User authentication tracking with breadcrumbs and user context
  • React Router v7 integration for navigation monitoring

Reviewed Changes

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

Show a summary per file
File Description
server.js Initializes Sentry for backend error tracking with Fastify integration
src/mount.ts Configures Sentry for frontend with React Router v7 tracing
src/App.tsx Adds user context tracking and wraps app with Sentry profiler
vite.config.js Integrates Sentry Vite plugin for source maps and component annotation
package.json Adds Sentry dependencies for Node.js, React, and Vite
.env.template Adds environment variables for Sentry DSN configuration
server/plugins/auth-utils.js Adds authentication success breadcrumbs
server/plugins/http-proxy.js Adds proxy operation tracking with tags and breadcrumbs
src/views/Login.tsx Adds login page visit tracking
src/spaces/onboarding/auth/AuthContextOnboarding.tsx Adds user authentication breadcrumbs
src/AppRouter.tsx Refactors to use Sentry-wrapped Routes component
server/encrypted-session.js Fixes missing semicolons for code consistency

andreaskienle
andreaskienle previously approved these changes Jul 18, 2025
Copy link
Contributor

@andreaskienle andreaskienle left a comment

Choose a reason for hiding this comment

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

Just some minor comments but looks really nice! 👍🏻

Co-authored-by: Andreas Kienle <[email protected]>
Copy link
Contributor

@andreaskienle andreaskienle left a comment

Choose a reason for hiding this comment

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

Nice!

a0umgd

@n3rdc4ptn n3rdc4ptn merged commit 7d902bb into main Jul 21, 2025
5 checks passed
@n3rdc4ptn n3rdc4ptn deleted the adding-sentry branch July 21, 2025 07:00
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