-
Notifications
You must be signed in to change notification settings - Fork 3
feat: simple sentry implementation #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 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.
…AuthContextOnboarding
There was a problem hiding this 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 |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this 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]>
…cy in Sentry configuration added try catch for url parsing
…N for consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

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:
server.js: Added Sentry initialization and Fastify error handler setup for backend error tracking. [1] [2]server/plugins/auth-utils.js: Added Sentry breadcrumbs for successful user authentication events.server/plugins/http-proxy.js: Integrated Sentry for tagging and adding breadcrumbs during HTTP proxy operations. [1] [2]Frontend:
src/App.tsx: Integrated Sentry for user tracking and wrapped theAppcomponent with Sentry's profiler. [1] [2]src/mount.ts: Configured Sentry for React Router v7 integration to monitor navigation and routing.src/spaces/onboarding/auth/AuthContextOnboarding.tsx: Added Sentry breadcrumbs for user authentication events.src/views/Login.tsx: Added Sentry breadcrumbs for tracking visits to the login page.Configuration Updates
.env.template: Added new environment variablesVITE_ENVIRONMENTandVITE_SENTRY_DSNfor Sentry configuration. [1] [2]vite.config.js: Integrated@sentry/vite-pluginfor 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
server/encrypted-session.js: Fixed missing semicolon and improved code formatting. [1] [2]src/App.tsx: Updated dependency array foruseEffectto includefrontendConfig.src/AppRouter.tsx: Refactored imports for better readability.