-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat: Sentry user context integration with error handling #1076
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
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
…cumentation Co-authored-by: egelhaus <[email protected]>
| Sentry.setTag('user.super_admin', null); | ||
| try { | ||
| Sentry.setUser(null); | ||
| Sentry.setTag('user.activated', ''); |
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.
@copilot Please use null to clear the user context everywhere.
Frontend and Backend
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.
Updated both frontend and backend to use null for clearing Sentry tags in commit b5bbf87.
Co-authored-by: egelhaus <[email protected]>
What kind of change does this PR introduce?
Feature - Sentry user context integration for error tracking across frontend and backend.
Why was this change needed?
Associates user information with Sentry error reports to improve debugging and issue triage. When errors occur, Sentry will now show which user was affected along with relevant metadata (org, role, tier).
Changes:
setSentryUserContextandclearSentryUserContextutilities for both React (frontend) and NestJS (backend)SentryUserInterceptorfor automatic backend request context settingContextWrappercomponent via useEffectnullfor tag clearing in both frontend and backendNEXT_PUBLIC_SENTRY_DSNin.env.exampleUsage (backend):
Other information:
The interceptor is provided but not globally registered - teams can choose their preferred integration level (global, controller, or method).
Checklist:
Put a "X" in the boxes below to indicate you have followed the checklist;
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.