Skip to content

Add org_id and strict_trace_continuation client options #1199

Description

@szokeasaurusrex

Add the Rust SDK configuration options required by the strict trace continuation spec: org_id and strict_trace_continuation. This task should expose the public API and resolve the SDK organization ID, but should not parse incoming baggage or enforce strict trace continuation yet. This is part of #1016 and replaces #1162 with a narrower, behavior-neutral API task.

Add API docs on the new fields and a CHANGELOG.md entry because this is a public API addition.

Implementation notes

Target files:

  • sentry-core/src/clientoptions.rs
  • CHANGELOG.md

Implementation:

  • Add pub org_id: Option<OrganizationId> to ClientOptions.
  • Add pub strict_trace_continuation: bool to ClientOptions.
  • Set defaults:
    • org_id: None
    • strict_trace_continuation: false
  • Include both fields in ClientOptions debug output.
  • Add an internal helper such as pub(crate) fn resolved_org_id(&self) -> Option<OrganizationId>.
  • Resolve the SDK organization ID by preferring explicit org_id, then self.dsn.as_ref().and_then(Dsn::org_id).
  • Document that org_id is mainly needed for self-hosted Sentry and local Relay setups.
  • Do not parse incoming baggage in this task.
  • Do not enforce the strict continuation decision in this task.
  • Do not create head-of-trace DSC in this task.

Tests:

  • Explicit org_id takes precedence over the DSN-derived organization ID.
  • DSN-derived organization ID is used when explicit org_id is absent.
  • Missing or unparsable DSN organization ID returns None.
  • Defaults are org_id: None and strict_trace_continuation: false.
  • Validate with cargo test -p sentry-core clientoptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions