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

Fix Scope::getTransaction() so that it returns also unsampled transactions #1334

Merged

Conversation

ste93cry
Copy link
Collaborator

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.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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