chore(core): Deprecate is_sampled methods - #1293
Open
szokeasaurusrex wants to merge 1 commit into
Open
Conversation
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
force-pushed
the
szokeasaurusrex/chore/deprecate-is-sampled
branch
from
August 12, 2026 20:30
353f950 to
3861fa5
Compare
szokeasaurusrex
changed the base branch from
szokeasaurusrex/feat/new-dsc-methods
to
master
August 12, 2026 20:30
szokeasaurusrex
marked this pull request as ready for review
August 12, 2026 21:04
giortzisg
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deprecate the
is_sampledmethods onTransaction,Span, andTransactionOrSpanbecause 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 internalsampledrepresentation to accurately represent the disabled-tracing states.This PR also removes
is_sampledassertions from the trace continuation tests. These assertions are not needed because the tests' purpose is to check trace continuation, not sampling decision propagation. Theseis_sampledchecks should probably never have been added there.We are not adding a replacement for
is_sampledbecause a review of code in thegetsentryorg and public GitHub repos did not reveal any usecases ofis_sampledthat could not be replaced with another reasonable existing alternative, e.g. the functions that return the trace propagation headers. Ingetsentry, no usages of these methods could be found outside the SDK itself.