fix(tracing): Don't send a null parent_span_id from sentry_set_trace - #2047
Open
limbonaut wants to merge 3 commits into
Open
fix(tracing): Don't send a null parent_span_id from sentry_set_trace#2047limbonaut wants to merge 3 commits into
limbonaut wants to merge 3 commits into
Conversation
An absent parent was stored as a null value, which serialized to "parent_span_id":null on the wire instead of being left out.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2047 +/- ##
==========================================
- Coverage 74.37% 74.37% -0.01%
==========================================
Files 103 103
Lines 26665 26667 +2
Branches 4852 4853 +1
==========================================
+ Hits 19832 19833 +1
+ Misses 5501 5498 -3
- Partials 1332 1336 +4 🚀 New features to boost your workflow:
|
jpnurmi
approved these changes
Sep 2, 2026
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.
sentry_set_tracewroteparent_span_idunconditionally, so a caller passing no parent got a stored null that serialized to"parent_span_id":nullon the wire, and a caller passing an empty string got"parent_span_id":"". Other SDKs leave the key out when there is no parent, and Native already does so elsewhere:sentry_regenerate_tracenever sets it, and the transaction path removes it when it is empty-ish. This guards the write so a NULL or zero-length parent omits the key, which is what a downstream SDK needs when it starts a fresh trace.