feat(tracing): Implement strict trace continuation#5829
Draft
feat(tracing): Implement strict trace continuation#5829
Conversation
Expose strictTraceContinuation and orgId options for cross-org trace validation. The JS layer is handled by @sentry/core 10.43.0 which already implements shouldContinueTrace and org_id propagation in DSC. This commit adds native bridge support to pass these options through to the Android (SentryAndroidOptions) and iOS (SentryOptions) native SDKs during initialization, and adds comprehensive tests covering: - Option pass-through to native SDK initialization - Option pass-through via Sentry.init() - continueTrace behavior with matching/mismatching org IDs - strictTraceContinuation=true/false decision matrix Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
Contributor
|
This was referenced Mar 17, 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.
📢 Type of change
📜 Description
Add support for
strictTraceContinuationandorgIdoptions in the React Native SDK.JS layer: No source changes needed —
@sentry/core10.43.0 already implements the full feature (option types,shouldContinueTrace(), org_id in DSC,continueTraceintegration). SinceReactNativeOptionsextends@sentry/core'sOptions, both options are automatically available.Native bridge: Pass
strictTraceContinuationandorgIdthrough to native iOS/Android SDKs during initialization, so that native-layer trace propagation also respects org ID validation once native SDKs are bumped.Changes:
RNSentryStart.java— PassstrictTraceContinuation(boolean) andorgId(string/number) toSentryAndroidOptionsRNSentryStart.m— PassstrictTraceContinuation(BOOL) andorgId(NSString) toSentryOptionsstrictTraceContinuation.test.ts(new) — 10 tests covering the full decision matrix via@sentry/core'scontinueTracesdk.test.ts— 4 tests verifying options flow throughSentry.init()wrapper.test.ts— 2 tests verifying options pass through the native bridge💡 Motivation and Context
Implements Strict Trace Continuation spec. Prevents cross-org trace continuation by validating org IDs in distributed traces.
Part of the Strict Trace Continuation initiative.
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled🔮 Next steps