Skip to content

Conversation

@ste93cry
Copy link
Contributor

Fixes #1333: Scope::getTransaction() was using the SpanRecorder to find the active transaction to return, but if the transaction is unsampled the recorder doesn't keep track of it and so null is returned. By adding a reference to the parent transaction inside each span, we can bypass the recorder and directly retrieve it, regardless of its sampling status. The original fix was implemented in getsentry/sentry-javascript#2952, and this is just a porting of it.

@ste93cry ste93cry added this to the 3.6 milestone Jul 14, 2022
@ste93cry ste93cry requested review from Jean85 and stayallive July 14, 2022 21:25
Copy link
Collaborator

@stayallive stayallive left a comment

Choose a reason for hiding this comment

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

Looks good to me 💪 (even a changelog entry 😎)

@Jean85 Jean85 merged commit b5da9f8 into master Jul 15, 2022
@Jean85 Jean85 deleted the fix-transaction-not-being-returned-from-scope-if-unsampled branch July 15, 2022 08:32
@ste93cry ste93cry modified the milestones: 3.6, 3.7 Jul 18, 2022
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.

Scope::getTransaction returns null when Transaction isn't sampled

4 participants