fix(tracing): autoSessionTracking not working on the server-side#466
Merged
fix(tracing): autoSessionTracking not working on the server-side#466
Conversation
Codecov Report
@@ Coverage Diff @@
## main #466 +/- ##
==========================================
- Coverage 70.83% 69.23% -1.61%
==========================================
Files 1 1
Lines 48 52 +4
Branches 22 21 -1
==========================================
+ Hits 34 36 +2
- Misses 11 13 +2
Partials 3 3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
rchl
added a commit
to LukasHirt/sentry-module
that referenced
this pull request
Dec 13, 2022
* main: fix(tracing): autoSessionTracking not working on the server-side (nuxt-community#466) fix: incorrect option name in the warning message (nuxt-community#467) chore(deps): don't update node version chore(deps): enable lock file maintenance for docs chore(docs): add .nvmrc for netlify and local dev chore(docs): update all sub-dependencies chore(docs): always build fix(deps): update devdependency @sentry/webpack-plugin to ^1.20.0 (nuxt-community#451) chore(deps): update all non-major dependencies (nuxt-community#449) chore(docs): fix documentation deploying, maybe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While investigating tracing functionality, I've noticed some broken/non-ideal behavior.
Due to Sentry
requestHandlerbeing created from therender:setupMiddlewarehook and Sentry being initialized from thebuild:compilehook (orreadyin production), the tracing functionality did not get initialized properly on the server-side because request handler was created before Sentry was initialized. Sentry request handler logic requires that Sentry is initialized first.Created a proxy that uses dummy handler until Sentry is initialized, at which point it gets replaced with Sentry's own handler.
The
build:compileandbuild:beforehooks run once per each bundle (client, server, modern, ...) so during the development, related code would trigger multiple times which could lead to issues or handlers being registered more than once.Created
callOncefunction that executes passed callback only once to ensure that those run only once.