Skip to content

feat(tracing): Implement strict trace continuation#5829

Merged
antonis merged 6 commits intomainfrom
worktree-strict-trace-continuation
Apr 16, 2026
Merged

feat(tracing): Implement strict trace continuation#5829
antonis merged 6 commits intomainfrom
worktree-strict-trace-continuation

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented Mar 17, 2026

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Add support for strictTraceContinuation and orgId options in the React Native SDK.

JS layer: No source changes needed — @sentry/core already implements the full feature (option types, shouldContinueTrace(), org_id in DSC, continueTrace integration). Since ReactNativeOptions extends @sentry/core's Options, both options are automatically available.

Native bridge: Pass strictTraceContinuation and orgId through to native iOS/Android SDKs during initialization.

Changes:

  • RNSentryStart.java — Pass strictTraceContinuation (boolean) and orgId (string/number) to SentryAndroidOptions
  • RNSentryStart.m — Pass strictTraceContinuation (BOOL) and orgId (NSString) to SentryOptions
  • strictTraceContinuation.test.ts (new) — 10 tests covering the full decision matrix via @sentry/core's continueTrace
  • sdk.test.ts — 4 tests verifying options flow through Sentry.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.

Native SDK dependencies now merged and bumped on main:

💚 How did you test it?

  • All 1238 tests pass (106 suites)
  • 16 new tests covering option pass-through and decision matrix

📝 Checklist

🔮 Next steps

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>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 17, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • feat(tracing): Implement strict trace continuation by antonis in #5829
  • Add deeplinkIntegration for automatic deep link breadcrumbs by alwx in #5983
  • fix(core): Retry native module resolution to prevent silent event drops by antonis in #5981
  • feat(core): Name navigation spans using dispatched action payload by alwx in #5982
  • ci: Gate size analysis on ready-to-merge label for PRs by antonis in #5963
  • chore(deps): update Android SDK to v8.38.0 by github-actions in #5971
  • chore(deps): update Sentry Android Gradle Plugin to v6.4.0 by github-actions in #5974
  • chore(deps): update Cocoa SDK to v9.10.0 by github-actions in #5972
  • chore(deps): update JavaScript SDK to v10.48.0 by github-actions in #5975
  • chore(deps): bump actions/github-script from 8 to 9 by dependabot in #5980
  • chore(deps): bump actions/create-github-app-token from 3.0.0 to 3.1.1 by dependabot in #5979
  • chore(deps): update Bundler Plugins to v5.2.0 by github-actions in #5968
  • chore(deps): bump axios from 1.13.5 to 1.15.0 by dependabot in #5978
  • chore(deps): bump addressable from 2.8.7 to 2.9.0 in /performance-tests by dependabot in #5969
  • chore(deps): bump basic-ftp from 5.2.0 to 5.2.2 by dependabot in #5977
  • fix(profiling): Fix app start transaction profile timestamp offset by antonis in #5962
  • fix(android): Use componentStack as fallback for missing error stack traces by antonis in #5965
  • chore(deps): bump addressable from 2.8.7 to 2.9.0 in /samples/react-native-macos by dependabot in #5967
  • chore(deps): bump addressable from 2.8.7 to 2.9.0 in /samples/react-native by dependabot in #5966
  • fix(ios): Add SENTRY_PROJECT_ROOT env var for monorepo support by antonis in #5961
  • feat(ios): Add attachAllThreads option by antonis in #5960
  • fix(core): Lazy-load Metro internal modules to prevent Expo 55 import errors by lucas-zimerman in #5958
  • chore(deps): update Cocoa SDK to v9.9.0 by github-actions in #5956
  • chore(deps): update Maestro to v2.4.0 by github-actions in #5955

Plus 9 more


🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 17, 2026

Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 4eb3fd1

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented Apr 13, 2026

@sentry review

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented Apr 13, 2026

@cursor review

Comment thread packages/core/ios/RNSentryStart.m
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 3fe2c78. Configure here.

@antonis antonis marked this pull request as ready for review April 13, 2026 12:32
Copy link
Copy Markdown
Contributor

@alwx alwx left a comment

Choose a reason for hiding this comment

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

The code for passing the props is really simple and straightforward, looks good to me.

@antonis antonis merged commit 93704e1 into main Apr 16, 2026
51 of 57 checks passed
@antonis antonis deleted the worktree-strict-trace-continuation branch April 16, 2026 09:59
antonis added a commit to getsentry/sentry-docs that referenced this pull request Apr 16, 2026
## DESCRIBE YOUR PR

Add `strictTraceContinuation` and `orgId` documentation to the React
Native distributed tracing guide.

**Changes:**
- **`react-native.mdx`** — Add strict trace continuation section with
explanation and code examples

## IS YOUR CHANGE URGENT?

- [ ] Urgent deadline (GA date, etc.):
- [ ] Other deadline:
- [x] None: Not urgent, can wait up to 1 week+

⚠️ Should be merged after
getsentry/sentry-react-native#5829 is released

## PRE-MERGE CHECKLIST

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)
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.

2 participants