diff --git a/CHANGELOG.md b/CHANGELOG.md index 27fe3c3677e..d933fa197cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ - Enhance regex patterns for native stackframes - Tracing headers (`sentry-trace` and `baggage`) are now attached and passed through even if performance is disabled ([#2788](https://github.com/getsentry/sentry-java/pull/2788)) +### Fixes + +- Remove code that set `tracesSampleRate` to `0.0` for Spring Boot if not set ([#2800](https://github.com/getsentry/sentry-java/pull/2800)) + ## 6.23.0 ### Features diff --git a/sentry-spring-boot-starter-jakarta/src/main/java/io/sentry/spring/boot/jakarta/SentryAutoConfiguration.java b/sentry-spring-boot-starter-jakarta/src/main/java/io/sentry/spring/boot/jakarta/SentryAutoConfiguration.java index 5c8c96be3b2..2d27bd31ae0 100644 --- a/sentry-spring-boot-starter-jakarta/src/main/java/io/sentry/spring/boot/jakarta/SentryAutoConfiguration.java +++ b/sentry-spring-boot-starter-jakarta/src/main/java/io/sentry/spring/boot/jakarta/SentryAutoConfiguration.java @@ -119,9 +119,6 @@ static class HubConfiguration { BuildConfig.SENTRY_SPRING_BOOT_JAKARTA_SDK_NAME + "/" + BuildConfig.VERSION_NAME); options.setSdkVersion(createSdkVersion(options)); addPackageAndIntegrationInfo(); - if (options.getTracesSampleRate() == null && options.getEnableTracing() == null) { - options.setTracesSampleRate(0.0); - } // Spring Boot sets ignored exceptions in runtime using reflection - where the generic // information is lost // its technically possible to set non-throwable class to `ignoredExceptionsForType` set diff --git a/sentry-spring-boot-starter-jakarta/src/test/kotlin/io/sentry/spring/boot/jakarta/SentryAutoConfigurationTest.kt b/sentry-spring-boot-starter-jakarta/src/test/kotlin/io/sentry/spring/boot/jakarta/SentryAutoConfigurationTest.kt index b686681b59e..7914c10c44c 100644 --- a/sentry-spring-boot-starter-jakarta/src/test/kotlin/io/sentry/spring/boot/jakarta/SentryAutoConfigurationTest.kt +++ b/sentry-spring-boot-starter-jakarta/src/test/kotlin/io/sentry/spring/boot/jakarta/SentryAutoConfigurationTest.kt @@ -225,7 +225,7 @@ class SentryAutoConfigurationTest { "sentry.dsn=http://key@localhost/proj" ).run { val options = it.getBean(SentryProperties::class.java) - assertThat(options.tracesSampleRate).isNotNull().isEqualTo(0.0) + assertThat(options.tracesSampleRate).isNull() } } diff --git a/sentry-spring-boot-starter/src/main/java/io/sentry/spring/boot/SentryAutoConfiguration.java b/sentry-spring-boot-starter/src/main/java/io/sentry/spring/boot/SentryAutoConfiguration.java index f7bc5108759..80647c565b1 100644 --- a/sentry-spring-boot-starter/src/main/java/io/sentry/spring/boot/SentryAutoConfiguration.java +++ b/sentry-spring-boot-starter/src/main/java/io/sentry/spring/boot/SentryAutoConfiguration.java @@ -119,9 +119,6 @@ static class HubConfiguration { BuildConfig.SENTRY_SPRING_BOOT_SDK_NAME + "/" + BuildConfig.VERSION_NAME); options.setSdkVersion(createSdkVersion(options)); addPackageAndIntegrationInfo(); - if (options.getTracesSampleRate() == null && options.getEnableTracing() == null) { - options.setTracesSampleRate(0.0); - } // Spring Boot sets ignored exceptions in runtime using reflection - where the generic // information is lost // its technically possible to set non-throwable class to `ignoredExceptionsForType` set diff --git a/sentry-spring-boot-starter/src/test/kotlin/io/sentry/spring/boot/SentryAutoConfigurationTest.kt b/sentry-spring-boot-starter/src/test/kotlin/io/sentry/spring/boot/SentryAutoConfigurationTest.kt index c87bcf674f7..3452c3a0937 100644 --- a/sentry-spring-boot-starter/src/test/kotlin/io/sentry/spring/boot/SentryAutoConfigurationTest.kt +++ b/sentry-spring-boot-starter/src/test/kotlin/io/sentry/spring/boot/SentryAutoConfigurationTest.kt @@ -225,7 +225,7 @@ class SentryAutoConfigurationTest { "sentry.dsn=http://key@localhost/proj" ).run { val options = it.getBean(SentryProperties::class.java) - assertThat(options.tracesSampleRate).isNotNull().isEqualTo(0.0) + assertThat(options.tracesSampleRate).isNull() } }