Skip to content

feat: Add strict trace continuation support#4972

Closed
giortzisg wants to merge 4 commits intomainfrom
feat/strict-trace-continuation
Closed

feat: Add strict trace continuation support#4972
giortzisg wants to merge 4 commits intomainfrom
feat/strict-trace-continuation

Conversation

@giortzisg
Copy link

@giortzisg giortzisg commented Mar 2, 2026

closed ... followed-up by #4981 after merging #4974

Summary

  • Extract org ID from DSN host (e.g., o123.ingest.sentry.io"123")
  • Add StrictTraceContinuation (bool, default false) and OrgId (string?) options to SentryOptions
  • Propagate org_id in Dynamic Sampling Context / baggage
  • Validate incoming traces per the decision matrix (mismatched org → new trace; strict mode rejects missing org)

Decision Matrix

Baggage org SDK org strict=false strict=true
1 1 Continue Continue
None 1 Continue New trace
1 None Continue New trace
None None Continue Continue
1 2 New trace New trace

Changes

  • Dsn.cs — org ID extraction from host using ^o(\d+)\. regex
  • SentryOptions.csStrictTraceContinuation, OrgId, and EffectiveOrgId
  • DynamicSamplingContext.csorg_id in DSC items
  • SentryPropagationContext.csShouldContinueTrace() logic in CreateFromHeaders()
  • Hub.cs — pass options to CreateFromHeaders()

Test plan

  • DSN org ID extraction tests (4 cases)
  • ShouldContinueTrace decision matrix tests (10 cases)
  • CreateFromHeaders integration tests (2 cases)

Closes #4963

🤖 Generated with Claude Code

Extract org ID from DSN host, add StrictTraceContinuation and OrgId
options, propagate org_id in Dynamic Sampling Context, and validate
incoming traces per the decision matrix.

Closes #4963
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 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).


Features ✨

  • feat: Add strict trace continuation support by giortzisg in #4972
  • feat: Network calls for Session Replay on Android by jamescrosswell in #4860

Fixes 🐛

  • fix: Log Warning instead of Error when ratelimited by bitsandfoxes in #4927

Dependencies ⬆️

Deps

  • chore(deps): update Native SDK to v0.13.1 by github-actions in #4964
  • chore(deps): update Cocoa SDK to v9.5.0 by github-actions in #4944
  • chore(deps): update Native SDK to v0.13.0 by github-actions in #4941
  • chore(deps): update CLI to v3.2.2 by github-actions in #4943
  • chore(deps): update Java SDK to v8.33.0 by github-actions in #4933
  • chore(deps): update CLI to v3.2.0 by github-actions in #4805
    • NOTE: Sentry CLI v3 removed support for the legacy API key authentication method. Sentry CLI now only supports authenticating with Auth Tokens. If you are using API key authentication via SentryApiKey, you need to generate an Auth Token and use SentryAuthToken, instead.
  • chore(deps): update Cocoa SDK to v9.4.1 by github-actions in #4928
  • chore(deps): update Native SDK to v0.12.8 by github-actions in #4929
  • Apps built using the Sentry SDK for .NET must now target iOS version 15 or higher. Previously only version 13 or higher was required. (#4781) by github-actions in #4781
  • Bump Cocoa SDK from v8.57.3 to v9.2.0 (#4781) by github-actions in #4781
  • chore(deps): update Native SDK to v0.12.7 by github-actions in #4920

Other

  • test(blazor): Add Playwright E2E tests for navigation breadcrumbs by bruno-garcia in #4908
  • test(android): Use volatile to produce SIGSEGV in native crash test by jpnurmi in #4919

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against fee48cf

giortzisg and others added 3 commits March 2, 2026 16:59
The test project does not have nullable reference types enabled,
so string? and BaggageHeader? annotations cause CS8632 errors.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@giortzisg
Copy link
Author

Closing in favor of a new implementation attempt.

@giortzisg giortzisg closed this Mar 4, 2026
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.

Implement strict trace continuation (org_id validation)

1 participant