Repository navigation
ref(core): Remove deprecated traceSampling option - #6415
Draft
sentry-junior[bot] wants to merge 3 commits into
Draft
sentry-junior[bot] wants to merge 3 commits into
sentry-junior[bot] wants to merge 3 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.
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]