Skip to content

chore(core): Deprecate is_sampled methods - #1293

Open
szokeasaurusrex wants to merge 1 commit into
masterfrom
szokeasaurusrex/chore/deprecate-is-sampled
Open

chore(core): Deprecate is_sampled methods#1293
szokeasaurusrex wants to merge 1 commit into
masterfrom
szokeasaurusrex/chore/deprecate-is-sampled

Conversation

@szokeasaurusrex

@szokeasaurusrex szokeasaurusrex commented Aug 12, 2026

Copy link
Copy Markdown
Member

Deprecate the is_sampled methods on Transaction, Span, and TransactionOrSpan because these methods no longer faithfully represent the sampling state of these objects now that the SDK can properly represent the tracing-disabled state. This will be even more true after the follow up PR #1286 is merged; that's because that PR changes these struct's internal sampled representation to accurately represent the disabled-tracing states.

This PR also removes is_sampled assertions from the trace continuation tests. These assertions are not needed because the tests' purpose is to check trace continuation, not sampling decision propagation. These is_sampled checks should probably never have been added there.

We are not adding a replacement for is_sampled because a review of code in the getsentry org and public GitHub repos did not reveal any usecases of is_sampled that could not be replaced with another reasonable existing alternative, e.g. the functions that return the trace propagation headers. In getsentry, no usages of these methods could be found outside the SDK itself.

Deprecate the `is_sampled` methods on `Transaction`, `Span`, and `TransactionOrSpan` because these methods no longer faithfully represent the sampling state of these objects now that the SDK can properly represent the tracing-disabled state. This will be even more true after the follow up PR #1286 is merged; that's because that PR changes these struct's internal `sampled` representation to accurately represent the disabled-tracing states.

This PR also removes `is_sampled` assertions from the trace continuation tests. These assertions are not needed because the tests' purpose is to check trace continuation, not sampling decision propagation. These `is_sampled` checks should probably never have been added there.

We are not adding a replacement for `is_sampled` because a review of code in the `getsentry` org and public GitHub repos did not reveal any usecases of `is_sampled` that could not be replaced with another reasonable existing alternative, e.g. the functions that return the trace propagation headers. In `getsentry`, no usages of these methods could be found outside the SDK itself.
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/chore/deprecate-is-sampled branch from 353f950 to 3861fa5 Compare August 12, 2026 20:30
@szokeasaurusrex
szokeasaurusrex changed the base branch from szokeasaurusrex/feat/new-dsc-methods to master August 12, 2026 20:30
@szokeasaurusrex
szokeasaurusrex marked this pull request as ready for review August 12, 2026 21:04
@szokeasaurusrex
szokeasaurusrex requested a review from a team as a code owner August 12, 2026 21:04
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.

2 participants