fix(core): [Session based Traces for Mobile 4] No longer unfreeze Baggage#5429
Draft
adinauer wants to merge 1 commit into
Draft
Conversation
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
This was referenced May 13, 2026
adinauer
commented
May 13, 2026
| false, | ||
| baggage.logger); | ||
| source.thirdPartyHeader, | ||
| source.mutable, |
Member
Author
There was a problem hiding this comment.
No longer unfreezing here since we can rely on Baggage still being mutable when creating a new transaction in head of trace scenario.
adinauer
commented
May 13, 2026
| final @NotNull Baggage baggage = | ||
| Baggage.copyWithOverrides( | ||
| propagationContext.getBaggage(), | ||
| transactionContext.getBaggage(), |
Member
Author
There was a problem hiding this comment.
Better to use the transactions own Baggage and copy over desired values from Scope instead of the other way around.
8 tasks
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.
PR Stack (Session based Traces for Mobile)
📜 Description
Avoids reusing the session propagation context's frozen baggage when remapping root transactions onto the session trace. The remapped transaction now keeps its own transaction baggage as the source and only overrides the session
traceIdandsampleRand.This preserves the session trace linkage without creating a mutable copy from already-frozen propagation baggage.
💡 Motivation and Context
Session trace lifecycle needs root transactions to share the session trace ID and sampling random value. The previous approach did that by copying the scope propagation baggage as mutable transaction baggage, effectively unfreezing baggage that had already been frozen during header propagation.
Keeping the transaction baggage as the source avoids that unfreeze behavior while still reusing the session trace identifiers required for session-based traces.
💚 How did you test it?
./gradlew spotlessApply apiDump./gradlew :sentry:test --tests='io.sentry.BaggageTest' --tests='io.sentry.TransactionContextTest'📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Continue the Session based Traces for Mobile stack.
#skip-changelog