Skip to content
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

In Sentry (exception handler), I would like to know what user (and on which workspace) has faced the exception #3153

Closed
charlesBochet opened this issue Dec 25, 2023 · 0 comments

Comments

@charlesBochet
Copy link
Member

Scope & Context

When we capture exceptions, we are sending them to our Exception Handler.

  • Backend: See ExceptionHandlerService / captureException
  • Frontend: See SentryInitEffect

These errors are sent to Sentry in production. They are working fine but we would like to know which user (and on which workspace) the error has been triggered. We would like to add user_id, workspaceMember_id, workspace_id to this payload when they are available (obviously if an error happens while the user is logged out, we cannot send them)

Technical inputs

See: https://develop.sentry.dev/sdk/event-payloads/user/
On the BE, the user information should be computed based on JWT token. Exceptions are handled here: global-exception-handler.util.ts. I am not sure about the best way to properly make the user availalble in this file, we might have to rather pass it as a parameter of globalExceptionHandler when we call it from GraphQLConfigService for example. See all the services calling globalExceptionHandler, we should make sure the user is passed in all cases

On the FE side, the user information is available in currentUser, currentWorkspace and currentWorkspaceMember states

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants