Repository navigation
ref(core): Remove deprecated traceSampling option - #6415
Open
sentry-junior[bot] wants to merge 5 commits into
Open
sentry-junior[bot] wants to merge 5 commits into
sentry-junior[bot] wants to merge 5 commits into
Conversation
Remove SentryOptions.isTraceSampling/setTraceSampling and the io.sentry.traces.trace-sampling Android manifest key. The option has defaulted to true since 6.5.0 and was marked experimental and deprecated in favor of tracePropagationTargets. Trace context and baggage are now always produced when a transaction has baggage, and outgoing tracing headers are controlled by tracePropagationTargets alone. Co-Authored-By: Alexander Dinauer <alexander.dinauer@sentry.io>
📲 Install BuildsAndroid
|
The mocked SentryOptions used to return false for isTraceSampling, which skipped baggage computation on transaction finish. With the option removed, SentryTracer always fills baggage values and needs a parsed DSN.
romtsn
approved these changes
Nov 10, 2026
romtsn
left a comment
Contributor
There was a problem hiding this comment.
LGTM! I agree we don't need a replacement switch for the trace header.
And one thing re. Apollo: theoretically, we could add Apollo span origins to ignoredSpanOrigins to stop creating headers, but it will also stop creating spans. Not sure if we should do it, but if we do, we need to add it to the migration guide.
adinauer
marked this pull request as ready for review
November 10, 2026 10:26
adinauer
requested review from
0xadam-brown and
markushi
and removed request for
a team
November 10, 2026 10:26
Resolve the changelog and Apollo interceptor conflicts while preserving Apollo's attachTracingHeaders option and removing the deprecated traceSampling gate. Remove stale test setup added on the base branch. Co-Authored-By: Claude <noreply@anthropic.com>
Member
|
@romtsn we recently merged a community PR to add an extra flag for the integration, that allows opting out of the headers separately. I'll expand the changelog entry and migration guide. |
Distinguish URL-aware propagation targets from Apollo v2 and document its attachTracingHeaders opt-out, which preserves span creation. Co-Authored-By: Claude <noreply@anthropic.com>
This branch has not been deployed
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.
📜 Description
Removes the
traceSamplingoption for 9.0:SentryOptions.isTraceSampling()/setTraceSampling(boolean)and the backing fieldio.sentry.traces.trace-sampling(ManifestMetadataReader.TRACE_SAMPLING)isTraceSampling()gates inSentryTracerandOtelSpanWrapper(traceContext()/toBaggageHeader()),TracingUtils.traceIfAllowed, andSentryApolloInterceptorisTraceSampling = truesetup lines that matched the defaultAfter this change:
traceContext()andtoBaggageHeader()return a value whenever the transaction has baggage.tracePropagationTargetsis the only setting that controls outgoingsentry-trace/baggageheaders.💡 Motivation and Context
traceSamplinghas defaulted totruesince 6.5.0-beta.2 (#2255). The getter is@ApiStatus.Experimental, the setter is@Deprecatedin favor oftracePropagationTargets, and both Javadocs say "will be removed without notice". Even so, it still worked as a hidden switch for trace propagation in core, OpenTelemetry, Apollo and Android. Removing it leaves one supported way to control propagation.Behavior change for anyone who set it to
false:tracePropagationTargets. Apollo is the exception, because it callsTracingUtils.tracedirectly and has no URL to match against.traceheader. Transactions with baggage always attach it now.💚 How did you test it?
Ran locally on JDK 21:
:sentry:test:TracingUtilsTest,SentryTracerTest,SpanTest,SentryClientTest:sentry-opentelemetry:sentry-opentelemetry-core:test:sentry-openfeign:testSentrySpanRest*CustomizerTestinsentry-spring-boot,sentry-spring-boot-jakartaandsentry-spring-boot-4:sentry-apollo:compileKotlin:sentry:apiDump, plusspotlessApplyon the changed JVM modulesNo Android SDK was available in the sandbox, so
sentry-android-core(ManifestMetadataReaderand its test) was not built locally. That change only deletes lines plus the now-unusedApiStatusimport. CI should cover it.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
traceheader. I don't think it does, but I'd like a reviewer to confirm.traceSampling/io.sentry.traces.trace-sampling.via alexander.dinauer.
--
View Junior Session [Sentry]