Conversation
- Parse org_id from DSN host (e.g. `o123.ingest.sentry.io` → `123`) - Add `strictTraceContinuation` and `orgId` options to SentryOptions - Propagate `sentry-org_id` in baggage/DSC - Validate incoming traces: mismatched org IDs start a new trace; strict mode also rejects traces with missing org IDs Spec: https://develop.sentry.dev/sdk/foundations/trace-propagation/#strict-trace-continuation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
iOS Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| c8596a6 | 1234.11 ms | 1241.19 ms | 7.08 ms |
| 57eccdf | 1247.91 ms | 1252.76 ms | 4.84 ms |
| d789735 | 1240.58 ms | 1246.41 ms | 5.82 ms |
| 396cb30 | 1265.06 ms | 1265.73 ms | 0.67 ms |
| 3615e19 | 1225.02 ms | 1234.57 ms | 9.55 ms |
| 1fff351 | 1265.77 ms | 1256.06 ms | -9.70 ms |
| cdf371b | 1246.24 ms | 1251.10 ms | 4.86 ms |
| 5f4cc67 | 1236.77 ms | 1237.94 ms | 1.17 ms |
| d5a1225 | 1252.46 ms | 1254.66 ms | 2.20 ms |
| 73a3c38 | 1263.37 ms | 1277.90 ms | 14.53 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| c8596a6 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 57eccdf | 5.73 MiB | 6.17 MiB | 453.80 KiB |
| d789735 | 5.53 MiB | 5.96 MiB | 443.28 KiB |
| 396cb30 | 5.53 MiB | 6.01 MiB | 488.17 KiB |
| 3615e19 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 1fff351 | 5.73 MiB | 6.17 MiB | 455.43 KiB |
| cdf371b | 5.53 MiB | 6.02 MiB | 501.23 KiB |
| 5f4cc67 | 5.73 MiB | 6.17 MiB | 455.49 KiB |
| d5a1225 | 5.73 MiB | 6.17 MiB | 453.73 KiB |
| 73a3c38 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
Previous results on branch: feat/strict-trace-continuation
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 25b589e | 1265.35 ms | 1262.23 ms | -3.12 ms |
| a48e7d7 | 1239.53 ms | 1238.38 ms | -1.16 ms |
| a1d3441 | 1224.39 ms | 1229.85 ms | 5.46 ms |
| 223b1b3 | 1242.87 ms | 1250.09 ms | 7.21 ms |
| 7c249a7 | 1234.02 ms | 1237.81 ms | 3.79 ms |
| 4afe986 | 1264.88 ms | 1255.48 ms | -9.41 ms |
| 80a6525 | 1251.04 ms | 1249.98 ms | -1.06 ms |
| f96a725 | 1263.67 ms | 1268.90 ms | 5.22 ms |
| e3d200a | 1251.73 ms | 1257.06 ms | 5.33 ms |
| 9c81fe0 | 1253.11 ms | 1254.57 ms | 1.46 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 25b589e | 5.73 MiB | 6.18 MiB | 464.45 KiB |
| a48e7d7 | 5.73 MiB | 6.17 MiB | 456.50 KiB |
| a1d3441 | 5.73 MiB | 6.18 MiB | 464.46 KiB |
| 223b1b3 | 5.73 MiB | 6.18 MiB | 464.42 KiB |
| 7c249a7 | 5.73 MiB | 6.17 MiB | 456.52 KiB |
| 4afe986 | 5.73 MiB | 6.18 MiB | 464.46 KiB |
| 80a6525 | 5.73 MiB | 6.17 MiB | 456.50 KiB |
| f96a725 | 5.73 MiB | 6.17 MiB | 456.50 KiB |
| e3d200a | 5.73 MiB | 6.17 MiB | 456.50 KiB |
| 9c81fe0 | 5.73 MiB | 6.18 MiB | 464.45 KiB |
Android Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 79f6b41 | 469.66 ms | 525.90 ms | 56.24 ms |
| d5a1225 | 377.37 ms | 366.56 ms | -10.81 ms |
| 0fb3800 | 465.64 ms | 536.77 ms | 71.13 ms |
| e04b24b | 504.72 ms | 516.43 ms | 11.71 ms |
| 584a4b7 | 367.74 ms | 353.83 ms | -13.91 ms |
| 3801d52 | 397.53 ms | 378.87 ms | -18.66 ms |
| 396cb30 | 405.70 ms | 427.56 ms | 21.86 ms |
| 7cfbbd6 | 499.69 ms | 592.24 ms | 92.55 ms |
| e200a70 | 433.06 ms | 437.00 ms | 3.94 ms |
| d789735 | 363.95 ms | 358.09 ms | -5.87 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 79f6b41 | 6.54 MiB | 7.69 MiB | 1.15 MiB |
| d5a1225 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| 0fb3800 | 6.54 MiB | 7.69 MiB | 1.15 MiB |
| e04b24b | 13.93 MiB | 15.00 MiB | 1.06 MiB |
| 584a4b7 | 14.09 MiB | 15.28 MiB | 1.19 MiB |
| 3801d52 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| 396cb30 | 13.93 MiB | 15.06 MiB | 1.13 MiB |
| 7cfbbd6 | 6.54 MiB | 7.70 MiB | 1.17 MiB |
| e200a70 | 13.93 MiB | 15.18 MiB | 1.25 MiB |
| d789735 | 13.93 MiB | 15.18 MiB | 1.25 MiB |
Previous results on branch: feat/strict-trace-continuation
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 80a6525 | 386.66 ms | 386.65 ms | -0.01 ms |
| f96a725 | 411.33 ms | 420.06 ms | 8.73 ms |
| c78ff38 | 433.65 ms | 433.69 ms | 0.03 ms |
| e3d200a | 421.91 ms | 432.42 ms | 10.51 ms |
| 9c81fe0 | 378.11 ms | 382.77 ms | 4.65 ms |
| 4afe986 | 385.21 ms | 380.48 ms | -4.73 ms |
| 7c249a7 | 366.72 ms | 369.06 ms | 2.34 ms |
| e3bfa44 | 390.52 ms | 373.63 ms | -16.89 ms |
| a48e7d7 | 371.18 ms | 361.09 ms | -10.09 ms |
| 25b589e | 437.27 ms | 466.53 ms | 29.26 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 80a6525 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| f96a725 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| c78ff38 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| e3d200a | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| 9c81fe0 | 14.31 MiB | 15.62 MiB | 1.31 MiB |
| 4afe986 | 14.31 MiB | 15.62 MiB | 1.31 MiB |
| 7c249a7 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| e3bfa44 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| a48e7d7 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| 25b589e | 14.31 MiB | 15.62 MiB | 1.31 MiB |
antonis
left a comment
There was a problem hiding this comment.
@buenaflor heads up that this is a fully AI generated implementation of the Strict Trace Continuation feature using the feature implementation skill
antonis
left a comment
There was a problem hiding this comment.
Moving this back to draft to also handle the Android/iOS native dependencies.
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Features
Internal Changes
🤖 This preview updates automatically when you update the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3567 +/- ##
==========================================
+ Coverage 86.78% 86.82% +0.03%
==========================================
Files 335 335
Lines 11934 11968 +34
==========================================
+ Hits 10357 10391 +34
Misses 1577 1577
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
Status update: Merged latest main and moved changelog to Unreleased. The Dart-layer implementation is self-contained and fully functional — trace propagation, org ID validation, and the decision matrix all work in pure Dart code. To deliver the full functionality, the native SDK dependencies need to be bumped so that native-originated trace contexts also include
|
📲 Install BuildsAndroid
|
|
@antonis I am not sure whether a backport is planned for v8 cocoa, so this feature may be blocked for now or we compromise and say that cocoa compatibility is limited for now |
Sounds good @buenaflor 👍 I'll proceed with that and open an issue to follow up when Cocoa is bumped |
| binarySizeTest: | ||
| diffMin: 900 KiB | ||
| diffMax: 1300 KiB | ||
| diffMax: 1350 KiB |
There was a problem hiding this comment.
The changes led to ~1345 KiB, exceeding the 1300 KiB threshold
|
@sentry review |
There was a problem hiding this comment.
✅ 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 223b1b3. Configure here.
This is now ready for another round 🙇 |
📜 Description
Implement Strict Trace Continuation in the Dart SDK.
strictTraceContinuation(bool) andorgId(String?) options onSentryOptionseffectiveOrgIdprefers explicit over DSN (trims whitespace)sentry-org_idin baggage and trace context headerSentryTransactionContext.fromSentryTraceper the spec decision matrix💡 Motivation and Context
Prevents cross-organization trace continuation by validating org IDs in distributed traces.
Part of the Strict Trace Continuation initiative.
Platform coverage
Sentry/HybridSDK 8.x💚 How did you test it?
46 new unit tests covering DSN parsing, option resolution, decision matrix, baggage/header propagation, and
fromSentryTracevalidation.📝 Checklist
sendDefaultPiiis enabled🔮 Next steps