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 |
|---|---|---|---|
| 55b7a00 | 1279.45 ms | 1274.58 ms | -4.87 ms |
| 0fb45d0 | 1273.24 ms | 1286.44 ms | 13.19 ms |
| e0c8591 | 1259.85 ms | 1257.31 ms | -2.54 ms |
| f3771ea | 1258.53 ms | 1255.22 ms | -3.32 ms |
| f761369 | 1261.69 ms | 1277.82 ms | 16.12 ms |
| fec56a1 | 1251.71 ms | 1241.31 ms | -10.40 ms |
| af96ef2 | 1260.79 ms | 1259.61 ms | -1.17 ms |
| b4b7781 | 1239.98 ms | 1245.67 ms | 5.69 ms |
| c26ed0a | 1244.11 ms | 1263.85 ms | 19.75 ms |
| c8596a6 | 1234.11 ms | 1241.19 ms | 7.08 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 55b7a00 | 5.73 MiB | 6.17 MiB | 453.79 KiB |
| 0fb45d0 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| e0c8591 | 5.53 MiB | 5.96 MiB | 444.86 KiB |
| f3771ea | 5.73 MiB | 6.17 MiB | 455.44 KiB |
| f761369 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| fec56a1 | 5.73 MiB | 6.17 MiB | 455.53 KiB |
| af96ef2 | 5.53 MiB | 6.02 MiB | 501.31 KiB |
| b4b7781 | 5.73 MiB | 6.17 MiB | 455.48 KiB |
| c26ed0a | 5.53 MiB | 5.97 MiB | 453.76 KiB |
| c8596a6 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
Previous results on branch: feat/strict-trace-continuation
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7c249a7 | 1234.02 ms | 1237.81 ms | 3.79 ms |
| 80a6525 | 1251.04 ms | 1249.98 ms | -1.06 ms |
| f96a725 | 1263.67 ms | 1268.90 ms | 5.22 ms |
| a48e7d7 | 1239.53 ms | 1238.38 ms | -1.16 ms |
| e3bfa44 | 1238.25 ms | 1234.53 ms | -3.72 ms |
| e3d200a | 1251.73 ms | 1257.06 ms | 5.33 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7c249a7 | 5.73 MiB | 6.17 MiB | 456.52 KiB |
| 80a6525 | 5.73 MiB | 6.17 MiB | 456.50 KiB |
| f96a725 | 5.73 MiB | 6.17 MiB | 456.50 KiB |
| a48e7d7 | 5.73 MiB | 6.17 MiB | 456.50 KiB |
| e3bfa44 | 5.73 MiB | 6.17 MiB | 456.50 KiB |
| e3d200a | 5.73 MiB | 6.17 MiB | 456.50 KiB |
Android Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4298701 | 524.40 ms | 633.30 ms | 108.90 ms |
| e200a70 | 433.06 ms | 437.00 ms | 3.94 ms |
| ec78888 | 457.94 ms | 519.96 ms | 62.02 ms |
| af96ef2 | 375.84 ms | 382.02 ms | 6.18 ms |
| 79f6b41 | 469.66 ms | 525.90 ms | 56.24 ms |
| 3615e19 | 468.38 ms | 504.71 ms | 36.33 ms |
| 0265ce5 | 406.39 ms | 418.48 ms | 12.09 ms |
| 9b99523 | 456.91 ms | 490.55 ms | 33.64 ms |
| c97f488 | 502.43 ms | 492.47 ms | -9.97 ms |
| 67de70c | 375.88 ms | 356.11 ms | -19.77 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4298701 | 6.54 MiB | 7.71 MiB | 1.17 MiB |
| e200a70 | 13.93 MiB | 15.18 MiB | 1.25 MiB |
| ec78888 | 6.54 MiB | 7.69 MiB | 1.15 MiB |
| af96ef2 | 13.93 MiB | 15.18 MiB | 1.25 MiB |
| 79f6b41 | 6.54 MiB | 7.69 MiB | 1.15 MiB |
| 3615e19 | 6.54 MiB | 7.70 MiB | 1.16 MiB |
| 0265ce5 | 14.09 MiB | 15.28 MiB | 1.19 MiB |
| 9b99523 | 6.54 MiB | 7.69 MiB | 1.15 MiB |
| c97f488 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| 67de70c | 14.31 MiB | 15.49 MiB | 1.19 MiB |
Previous results on branch: feat/strict-trace-continuation
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| f96a725 | 411.33 ms | 420.06 ms | 8.73 ms |
| e3bfa44 | 390.52 ms | 373.63 ms | -16.89 ms |
| 80a6525 | 386.66 ms | 386.65 ms | -0.01 ms |
| a48e7d7 | 371.18 ms | 361.09 ms | -10.09 ms |
| 7c249a7 | 366.72 ms | 369.06 ms | 2.34 ms |
| e3d200a | 421.91 ms | 432.42 ms | 10.51 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| f96a725 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| e3bfa44 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| 80a6525 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| a48e7d7 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| 7c249a7 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| e3d200a | 14.31 MiB | 15.49 MiB | 1.19 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
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
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. |
❌ 1 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
|
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 |

📜 Description
Implement Strict Trace Continuation in the Dart SDK.
Changes:
dsn.dart— Extract org_id from DSN host using^o(\d+)\.regexsentry_options.dart— AddstrictTraceContinuation(bool),orgId(String?), andeffectiveOrgIdgettersentry_baggage.dart— Addsentry-org_idget/set, propagate insetValuesFromScopesentry_trace_context_header.dart— AddorgIdfield, propagate through JSON/baggage serializationsentry_tracer.dart— Include org_id when creating trace context headerstracing_utils.dart— AddshouldContinueTrace()implementing the decision matrixsentry_transaction_context.dart— Validate org ID infromSentryTrace, start new trace on mismatch💡 Motivation and Context
Prevents cross-organization trace continuation by validating org IDs in distributed traces. When org IDs don't match, the SDK starts a fresh trace instead of continuing the foreign one.
Part of the Strict Trace Continuation initiative.
💚 How did you test it?
strict_trace_continuation_test.dart) covering:📝 Checklist
sendDefaultPiiis enabled🔮 Next steps