Skip to content

Commit

Permalink
Deprecate enableTracing in v7 (#3777)
Browse files Browse the repository at this point in the history
* deprecate enableTracing

* changelog
  • Loading branch information
adinauer authored Oct 10, 2024
1 parent fe8ba2c commit f79c9c1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- Deprecate `enableTracing` option ([#3777](https://github.com/getsentry/sentry-java/pull/3777))

## 7.15.0

### Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ final class ManifestMetadataReader {
static final String UNCAUGHT_EXCEPTION_HANDLER_ENABLE =
"io.sentry.uncaught-exception-handler.enable";

static final String TRACING_ENABLE = "io.sentry.traces.enable";
@Deprecated static final String TRACING_ENABLE = "io.sentry.traces.enable";
static final String TRACES_SAMPLE_RATE = "io.sentry.traces.sample-rate";
static final String TRACES_ACTIVITY_ENABLE = "io.sentry.traces.activity.enable";
static final String TRACES_ACTIVITY_AUTO_FINISH_ENABLE =
Expand Down
9 changes: 8 additions & 1 deletion sentry/src/main/java/io/sentry/SentryOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -913,14 +913,21 @@ public void setSampleRate(Double sampleRate) {
* <p>NOTE: There is also {@link SentryOptions#isTracingEnabled()} which checks other options as
* well.
*
* @deprecated We're removing enableTracing in 8.0
* @return true if enabled, false if disabled, null can mean enabled if {@link
* SentryOptions#getTracesSampleRate()} or {@link SentryOptions#getTracesSampler()} are set.
*/
@Deprecated
public @Nullable Boolean getEnableTracing() {
return enableTracing;
}

/** Enables generation of transactions and propagation of trace data. */
/**
* Enables generation of transactions and propagation of trace data.
*
* @deprecated We're removing enableTracing in 8.0
*/
@Deprecated
public void setEnableTracing(@Nullable Boolean enableTracing) {
this.enableTracing = enableTracing;
}
Expand Down
1 change: 1 addition & 0 deletions sentry/src/main/java/io/sentry/TracesSampler.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public TracesSampler(final @NotNull SentryOptions options) {
this.random = random;
}

@SuppressWarnings("deprecation")
@NotNull
TracesSamplingDecision sample(final @NotNull SamplingContext samplingContext) {
final TracesSamplingDecision samplingContextSamplingDecision =
Expand Down

0 comments on commit f79c9c1

Please sign in to comment.