diff --git a/CHANGELOG.md b/CHANGELOG.md index 295f7d4650..8aa5bb8d78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ `logsEnabled` argument. The deprecated constructor without `minimumLevel` is removed. - Manually constructed `SentryTimberIntegration` and `SentryTimberTree` instances require a `logsEnabled` argument. Pass `false` to keep Sentry Logs disabled. +- Disable tracing for HTTP `OPTIONS` requests by default. Set `traceOptionsRequests` to `true` to + preserve the previous behavior ([#6254](https://github.com/getsentry/sentry-java/pull/6254)) - Remove the Apache HttpClient transport and stop publishing `sentry-apache-http-client-5` ([#6214](https://github.com/getsentry/sentry-java/pull/6214)) ### Features diff --git a/sentry/src/main/java/io/sentry/SentryOptions.java b/sentry/src/main/java/io/sentry/SentryOptions.java index 36b34630d4..2c98a77c3e 100644 --- a/sentry/src/main/java/io/sentry/SentryOptions.java +++ b/sentry/src/main/java/io/sentry/SentryOptions.java @@ -517,9 +517,8 @@ public class SentryOptions implements RateLimiterConfig { private @NotNull IThreadChecker threadChecker = NoOpThreadChecker.getInstance(); - // TODO [MAJOR] this should default to false on the next major /** Whether OPTIONS requests should be traced. */ - private boolean traceOptionsRequests = true; + private boolean traceOptionsRequests = false; /** Whether database transaction spans (BEGIN, COMMIT, ROLLBACK) should be traced. */ private boolean enableDatabaseTransactionTracing = false; diff --git a/sentry/src/test/java/io/sentry/SentryOptionsTest.kt b/sentry/src/test/java/io/sentry/SentryOptionsTest.kt index 3d38f48d08..cf18c4870d 100644 --- a/sentry/src/test/java/io/sentry/SentryOptionsTest.kt +++ b/sentry/src/test/java/io/sentry/SentryOptionsTest.kt @@ -304,6 +304,11 @@ class SentryOptionsTest { assertFalse(options.isTracingEnabled) } + @Test + fun `traceOptionsRequests defaults to false`() { + assertThat(SentryOptions().isTraceOptionsRequests).isFalse() + } + @Test fun `when there's no cacheDirPath, outboxPath returns null`() { val options = SentryOptions()