From e048ffd275257e94d6e8d7190b43da6f658bfc77 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Wed, 14 Oct 2026 11:37:44 +0200 Subject: [PATCH 1/2] feat(core): Disable OPTIONS request tracing by default Skip tracing HTTP OPTIONS requests by default in v9 to avoid creating transactions for CORS preflight traffic. Applications can opt back in with traceOptionsRequests. Fixes #4163 Co-Authored-By: Codex --- sentry/src/main/java/io/sentry/SentryOptions.java | 3 +-- sentry/src/test/java/io/sentry/SentryOptionsTest.kt | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) 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() From 882e600ed1c2adbdb7302a2ac2ec2dc56be6bb70 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Wed, 14 Oct 2026 11:38:52 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) 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