Skip to content

Commit ea7ae0d

Browse files
committed
remove enableTracing
1 parent 4663d03 commit ea7ae0d

File tree

29 files changed

+43
-224
lines changed

29 files changed

+43
-224
lines changed

sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ final class ManifestMetadataReader {
5757
static final String UNCAUGHT_EXCEPTION_HANDLER_ENABLE =
5858
"io.sentry.uncaught-exception-handler.enable";
5959

60-
static final String TRACING_ENABLE = "io.sentry.traces.enable";
6160
static final String TRACES_SAMPLE_RATE = "io.sentry.traces.sample-rate";
6261
static final String TRACES_ACTIVITY_ENABLE = "io.sentry.traces.activity.enable";
6362
static final String TRACES_ACTIVITY_AUTO_FINISH_ENABLE =
@@ -286,10 +285,6 @@ static void applyMetadata(
286285
COLLECT_ADDITIONAL_CONTEXT,
287286
options.isCollectAdditionalContext()));
288287

289-
if (options.getEnableTracing() == null) {
290-
options.setEnableTracing(readBoolNullable(metadata, logger, TRACING_ENABLE, null));
291-
}
292-
293288
if (options.getTracesSampleRate() == null) {
294289
final Double tracesSampleRate = readDouble(metadata, logger, TRACES_SAMPLE_RATE);
295290
if (tracesSampleRate != -1) {

sentry-android-core/src/main/java/io/sentry/android/core/SentryAndroidOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public final class SentryAndroidOptions extends SentryOptions {
5454
* Enables the Auto instrumentation for Activity lifecycle tracing.
5555
*
5656
* <ul>
57-
* <li>It also requires setting any of {@link SentryOptions#getEnableTracing()}, {@link
58-
* SentryOptions#getTracesSampleRate()} or {@link SentryOptions#getTracesSampler()}.
57+
* <li>It also requires setting any of {@link SentryOptions#getTracesSampleRate()} or {@link
58+
* SentryOptions#getTracesSampler()}.
5959
* </ul>
6060
*
6161
* <ul>

sentry-android-core/src/test/java/io/sentry/android/core/ActivityLifecycleIntegrationTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ class ActivityLifecycleIntegrationTest {
13601360
fun `starts new trace if performance is disabled`() {
13611361
val sut = fixture.getSut()
13621362
val activity = mock<Activity>()
1363-
fixture.options.enableTracing = false
1363+
fixture.options.tracesSampleRate = null
13641364

13651365
val argumentCaptor: ArgumentCaptor<ScopeCallback> = ArgumentCaptor.forClass(ScopeCallback::class.java)
13661366
val scope = Scope(fixture.options)
@@ -1381,7 +1381,7 @@ class ActivityLifecycleIntegrationTest {
13811381
fun `sets the activity as the current screen`() {
13821382
val sut = fixture.getSut()
13831383
val activity = mock<Activity>()
1384-
fixture.options.enableTracing = false
1384+
fixture.options.tracesSampleRate = null
13851385

13861386
val argumentCaptor: ArgumentCaptor<ScopeCallback> = ArgumentCaptor.forClass(ScopeCallback::class.java)
13871387
val scope = mock<IScope>()
@@ -1401,7 +1401,7 @@ class ActivityLifecycleIntegrationTest {
14011401
fun `does not start another new trace if one has already been started but does after activity was destroyed`() {
14021402
val sut = fixture.getSut()
14031403
val activity = mock<Activity>()
1404-
fixture.options.enableTracing = false
1404+
fixture.options.tracesSampleRate = null
14051405

14061406
val argumentCaptor: ArgumentCaptor<ScopeCallback> = ArgumentCaptor.forClass(ScopeCallback::class.java)
14071407
val scope = Scope(fixture.options)

sentry-android-core/src/test/java/io/sentry/android/core/ManifestMetadataReaderTest.kt

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -672,45 +672,6 @@ class ManifestMetadataReaderTest {
672672
assertNull(fixture.options.tracesSampleRate)
673673
}
674674

675-
@Test
676-
fun `applyMetadata reads enableTracing from metadata`() {
677-
// Arrange
678-
val bundle = bundleOf(ManifestMetadataReader.TRACING_ENABLE to true)
679-
val context = fixture.getContext(metaData = bundle)
680-
681-
// Act
682-
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)
683-
684-
// Assert
685-
assertEquals(true, fixture.options.enableTracing)
686-
}
687-
688-
@Test
689-
fun `applyMetadata does not override enableTracing from options`() {
690-
// Arrange
691-
fixture.options.enableTracing = true
692-
val bundle = bundleOf(ManifestMetadataReader.TRACING_ENABLE to false)
693-
val context = fixture.getContext(metaData = bundle)
694-
695-
// Act
696-
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)
697-
698-
// Assert
699-
assertEquals(true, fixture.options.enableTracing)
700-
}
701-
702-
@Test
703-
fun `applyMetadata without specifying enableTracing, stays null`() {
704-
// Arrange
705-
val context = fixture.getContext()
706-
707-
// Act
708-
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)
709-
710-
// Assert
711-
assertNull(fixture.options.enableTracing)
712-
}
713-
714675
@Test
715676
fun `applyMetadata reads enableAutoActivityLifecycleTracing to options`() {
716677
// Arrange

sentry-android-navigation/src/test/java/io/sentry/android/navigation/SentryNavigationListenerTest.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class SentryNavigationListenerTest {
5555
toRoute: String? = "route",
5656
toId: String? = "destination-id-1",
5757
enableBreadcrumbs: Boolean = true,
58-
enableTracing: Boolean = true,
58+
enableNavigationTracing: Boolean = true,
5959
enableScreenTracking: Boolean = true,
6060
tracesSampleRate: Double? = 1.0,
6161
hasViewIdInRes: Boolean = true,
@@ -100,7 +100,7 @@ class SentryNavigationListenerTest {
100100
return SentryNavigationListener(
101101
scopes,
102102
enableBreadcrumbs,
103-
enableTracing,
103+
enableNavigationTracing,
104104
traceOriginAppendix
105105
)
106106
}
@@ -203,7 +203,7 @@ class SentryNavigationListenerTest {
203203

204204
@Test
205205
fun `onDestinationChanged does not start tracing when tracing is disabled`() {
206-
val sut = fixture.getSut(enableTracing = false)
206+
val sut = fixture.getSut(enableNavigationTracing = false)
207207

208208
sut.onDestinationChanged(fixture.navController, fixture.destination, null)
209209

@@ -215,7 +215,7 @@ class SentryNavigationListenerTest {
215215

216216
@Test
217217
fun `onDestinationChanged does not start tracing when tracesSampleRate is not set`() {
218-
val sut = fixture.getSut(enableTracing = true, tracesSampleRate = null)
218+
val sut = fixture.getSut(enableNavigationTracing = true, tracesSampleRate = null)
219219

220220
sut.onDestinationChanged(fixture.navController, fixture.destination, null)
221221

@@ -361,7 +361,7 @@ class SentryNavigationListenerTest {
361361

362362
@Test
363363
fun `starts new trace if performance is disabled`() {
364-
val sut = fixture.getSut(enableTracing = false)
364+
val sut = fixture.getSut(enableNavigationTracing = false)
365365

366366
val argumentCaptor: ArgumentCaptor<ScopeCallback> =
367367
ArgumentCaptor.forClass(ScopeCallback::class.java)

sentry-samples/sentry-samples-spring-boot-jakarta/src/main/resources/application.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ sentry.logging.minimum-event-level=info
99
sentry.logging.minimum-breadcrumb-level=debug
1010
# Performance configuration
1111
sentry.traces-sample-rate=1.0
12-
sentry.enable-tracing=true
1312
sentry.ignored-checkins=ignored_monitor_slug_1,ignored_monitor_slug_2
1413
sentry.debug=true
1514
sentry.graphql.ignored-error-types=SOME_ERROR,ANOTHER_ERROR

sentry-samples/sentry-samples-spring-boot-webflux-jakarta/src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ sentry.max-breadcrumbs=150
88
sentry.logging.minimum-event-level=info
99
sentry.logging.minimum-breadcrumb-level=debug
1010
sentry.reactive.thread-local-accessor-enabled=true
11-
sentry.enable-tracing=true
11+
sentry.traces-sample-rate=1.0
1212
sentry.enable-backpressure-handling=true
1313
sentry.enable-spotlight=true

sentry-samples/sentry-samples-spring-boot-webflux/src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sentry.max-breadcrumbs=150
77
# Logback integration configuration options
88
sentry.logging.minimum-event-level=info
99
sentry.logging.minimum-breadcrumb-level=debug
10-
sentry.enable-tracing=true
10+
sentry.traces-sample-rate=1.0
1111
spring.graphql.graphiql.enabled=true
1212
spring.graphql.websocket.path=/graphql
1313
spring.graphql.schema.printer.enabled=true

sentry-samples/sentry-samples-spring-boot/src/main/resources/application.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ sentry.logging.minimum-event-level=info
99
sentry.logging.minimum-breadcrumb-level=debug
1010
# Performance configuration
1111
sentry.traces-sample-rate=1.0
12-
sentry.enable-tracing=true
1312
sentry.ignored-checkins=ignored_monitor_slug_1,ignored_monitor_slug_2
1413
sentry.debug=true
1514
sentry.graphql.ignored-error-types=SOME_ERROR,ANOTHER_ERROR

sentry-spring-boot-jakarta/src/main/java/io/sentry/spring/boot/jakarta/SentryAutoConfiguration.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,10 +454,6 @@ public SentryTracingCondition() {
454454
super(ConfigurationPhase.REGISTER_BEAN);
455455
}
456456

457-
@ConditionalOnProperty(name = "sentry.enable-tracing")
458-
@SuppressWarnings("UnusedNestedClass")
459-
private static class SentryEnableTracingCondition {}
460-
461457
@ConditionalOnProperty(name = "sentry.traces-sample-rate")
462458
@SuppressWarnings("UnusedNestedClass")
463459
private static class SentryTracesSampleRateCondition {}

0 commit comments

Comments
 (0)