feat: Implement strict trace continuation by giortzisg · Pull Request #2872 · getsentry/sentry-ruby

dingsdax

Add support for org_id extraction from DSN and strict trace continuation
to control whether the SDK continues traces from third-party services.

Changes:
- Extract org_id from DSN host (e.g., "o123.ingest.sentry.io" -> "123")
- Add `org_id` config option to explicitly set the organization ID
- Add `strict_trace_continuation` boolean config option (default: false)
- Propagate org_id in baggage as `sentry-org_id`
- Validate incoming trace org_id against SDK org_id per decision matrix
- Add comprehensive tests for all scenarios

Closes #2865

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The test DSN uses o447951.ingest.sentry.io, so the new org_id
propagation correctly adds sentry-org_id=447951 to baggage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@sl0thentr0py

sl0thentr0py

cursor[bot]

sentry[bot]

@sl0thentr0py