Skip to content

Commit 1eb8476

Browse files
authored
Remove deprecations (#3780)
* attach request body for application/x-www-form-urlencoded * extend tests * changelog * Add support for v22 of graphql-java, new modules sentry-graphql-22 and sentry-graphql-core * Add back callback interface and constants as deprecated * Replace GraphQlSourceBuilderCustomizer with directly providing a SentryInstrumentation bean if missing * Support graphql-java v22 in spring integrations * Close scopes before replacing options on global scope * changelog * fix api file * remove metrics * remove enableTracing * remove deprecations * remove user other legacy handling code * changelog
1 parent 93ee8ee commit 1eb8476

File tree

41 files changed

+37
-734
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+37
-734
lines changed

CHANGELOG.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,21 @@
1515
- Manifest option `io.sentry.session-replay.error-sample-rate` was renamed to `io.sentry.session-replay.on-error-sample-rate` ([#3637](https://github.com/getsentry/sentry-java/pull/3637))
1616
- Replace `synchronized` methods and blocks with `ReentrantLock` (`AutoClosableReentrantLock`) ([#3715](https://github.com/getsentry/sentry-java/pull/3715))
1717
- If you are subclassing any Sentry classes, please check if the parent class used `synchronized` before. Please make sure to use the same lock object as the parent class in that case.
18-
- `traceHeaders` method has been removed ([#3718](https://github.com/getsentry/sentry-java/pull/3718))
19-
- `reportFullDisplayed` method has been removed ([#3717](https://github.com/getsentry/sentry-java/pull/3717))
20-
- This was a typo, `reportFullyDisplayed` still remains.
18+
- `traceOrigins` option (`io.sentry.traces.tracing-origins` in manifest) has been removed, please use `tracePropagationTargets` (`io.sentry.traces.trace-propagation-targets` in manifest`) instead ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
19+
- `profilingEnabled` option (`io.sentry.traces.profiling.enable` in manifest) has been removed, please use `profilesSampleRate` (`io.sentry.traces.profiling.sample-rate` instead) instead ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
20+
- `shutdownTimeout` option has been removed, please use `shutdownTimeoutMillis` instead ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
21+
- `profilingTracesIntervalMillis` option for Android has been removed ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
22+
- `io.sentry.session-tracking.enable` manifest option has been removed ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
23+
- `Sentry.traceHeaders()` method has been removed, please use `Sentry.getTraceparent()` instead ([#3718](https://github.com/getsentry/sentry-java/pull/3718))
24+
- `Sentry.reportFullDisplayed()` method has been removed, please use `Sentry.reportFullyDisplayed()` instead ([#3717](https://github.com/getsentry/sentry-java/pull/3717))
25+
- `User.other` has been removed, please use `data` instead ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
26+
- `SdkVersion.getIntegrations()` has been removed, please use `getIntegrationSet` instead ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
27+
- `SdkVersion.getPackages()` has been removed, please use `getPackageSet()` instead ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
28+
- `Device.language` has been removed, please use `locale` instead ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
29+
- `TraceContext.user` and `TraceContextUser` class have been removed, please use `userId` on `TraceContext` instead ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
30+
- `TransactionContext.fromSentryTrace()` has been removed, please use `Sentry.continueTrace()` instead ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
31+
- `SentryDataFetcherExceptionHandler` has been removed, please use `SentryGenericDataFetcherExceptionHandler` in combination with `SentryInstrumentation` instead ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
32+
- One of the `AndroidTransactionProfiler` constructors has been removed, please use a different one ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
2133

2234
### Features
2335

sentry-android-core/api/sentry-android-core.api

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ public final class io/sentry/android/core/SentryAndroidOptions : io/sentry/Sentr
269269
public fun getDebugImagesLoader ()Lio/sentry/android/core/IDebugImagesLoader;
270270
public fun getFrameMetricsCollector ()Lio/sentry/android/core/internal/util/SentryFrameMetricsCollector;
271271
public fun getNativeSdkName ()Ljava/lang/String;
272-
public fun getProfilingTracesIntervalMillis ()I
273272
public fun getStartupCrashDurationThresholdMillis ()J
274273
public fun isAnrEnabled ()Z
275274
public fun isAnrReportInDebug ()Z
@@ -314,7 +313,6 @@ public final class io/sentry/android/core/SentryAndroidOptions : io/sentry/Sentr
314313
public fun setEnableSystemEventBreadcrumbs (Z)V
315314
public fun setFrameMetricsCollector (Lio/sentry/android/core/internal/util/SentryFrameMetricsCollector;)V
316315
public fun setNativeSdkName (Ljava/lang/String;)V
317-
public fun setProfilingTracesIntervalMillis (I)V
318316
public fun setReportHistoricalAnrs (Z)V
319317
}
320318

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import android.os.SystemClock;
1212
import io.sentry.DateUtils;
1313
import io.sentry.ILogger;
14-
import io.sentry.IScopes;
1514
import io.sentry.ISentryExecutorService;
1615
import io.sentry.ISentryLifecycleToken;
1716
import io.sentry.ITransaction;
@@ -51,20 +50,6 @@ final class AndroidTransactionProfiler implements ITransactionProfiler {
5150
private @NotNull Date profileStartTimestamp;
5251
private final @NotNull AutoClosableReentrantLock lock = new AutoClosableReentrantLock();
5352

54-
/**
55-
* @deprecated please use a constructor that doesn't takes a {@link IScopes} instead, as it would
56-
* be ignored anyway.
57-
*/
58-
@Deprecated
59-
public AndroidTransactionProfiler(
60-
final @NotNull Context context,
61-
final @NotNull SentryAndroidOptions sentryAndroidOptions,
62-
final @NotNull BuildInfoProvider buildInfoProvider,
63-
final @NotNull SentryFrameMetricsCollector frameMetricsCollector,
64-
final @NotNull IScopes scopes) {
65-
this(context, sentryAndroidOptions, buildInfoProvider, frameMetricsCollector);
66-
}
67-
6853
public AndroidTransactionProfiler(
6954
final @NotNull Context context,
7055
final @NotNull SentryAndroidOptions sentryAndroidOptions,

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ public Device collectDeviceInformation(
133133
}
134134

135135
final @NotNull Locale locale = Locale.getDefault();
136-
if (device.getLanguage() == null) {
137-
device.setLanguage(locale.getLanguage());
138-
}
139136
if (device.getLocale() == null) {
140137
device.setLocale(locale.toString()); // eg en_US
141138
}

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

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ final class ManifestMetadataReader {
3838
static final String SDK_NAME = "io.sentry.sdk.name";
3939
static final String SDK_VERSION = "io.sentry.sdk.version";
4040

41-
// TODO [MAJOR]: remove on 6.x in favor of SESSION_AUTO_TRACKING_ENABLE
42-
static final String SESSION_TRACKING_ENABLE = "io.sentry.session-tracking.enable";
43-
4441
static final String AUTO_SESSION_TRACKING_ENABLE = "io.sentry.auto-session-tracking.enable";
4542
static final String SESSION_TRACKING_TIMEOUT_INTERVAL_MILLIS =
4643
"io.sentry.session-tracking.timeout-interval-millis";
@@ -65,14 +62,9 @@ final class ManifestMetadataReader {
6562

6663
static final String TTFD_ENABLE = "io.sentry.traces.time-to-full-display.enable";
6764

68-
static final String TRACES_PROFILING_ENABLE = "io.sentry.traces.profiling.enable";
6965
static final String PROFILES_SAMPLE_RATE = "io.sentry.traces.profiling.sample-rate";
7066

7167
@ApiStatus.Experimental static final String TRACE_SAMPLING = "io.sentry.traces.trace-sampling";
72-
73-
// TODO [MAJOR]: remove in favor of TRACE_PROPAGATION_TARGETS
74-
@Deprecated static final String TRACING_ORIGINS = "io.sentry.traces.tracing-origins";
75-
7668
static final String TRACE_PROPAGATION_TARGETS = "io.sentry.traces.trace-propagation-targets";
7769

7870
static final String ATTACH_THREADS = "io.sentry.attach-threads";
@@ -150,14 +142,13 @@ static void applyMetadata(
150142

151143
options.setAnrEnabled(readBool(metadata, logger, ANR_ENABLE, options.isAnrEnabled()));
152144

153-
// deprecated
154-
final boolean enableSessionTracking =
155-
readBool(
156-
metadata, logger, SESSION_TRACKING_ENABLE, options.isEnableAutoSessionTracking());
157-
158145
// use enableAutoSessionTracking as fallback
159146
options.setEnableAutoSessionTracking(
160-
readBool(metadata, logger, AUTO_SESSION_TRACKING_ENABLE, enableSessionTracking));
147+
readBool(
148+
metadata,
149+
logger,
150+
AUTO_SESSION_TRACKING_ENABLE,
151+
options.isEnableAutoSessionTracking()));
161152

162153
if (options.getSampleRate() == null) {
163154
final Double sampleRate = readDouble(metadata, logger, SAMPLE_RATE);
@@ -309,9 +300,6 @@ static void applyMetadata(
309300
TRACES_ACTIVITY_AUTO_FINISH_ENABLE,
310301
options.isEnableActivityLifecycleTracingAutoFinish()));
311302

312-
options.setProfilingEnabled(
313-
readBool(metadata, logger, TRACES_PROFILING_ENABLE, options.isProfilingEnabled()));
314-
315303
if (options.getProfilesSampleRate() == null) {
316304
final Double profilesSampleRate = readDouble(metadata, logger, PROFILES_SAMPLE_RATE);
317305
if (profilesSampleRate != -1) {
@@ -334,15 +322,7 @@ static void applyMetadata(
334322
List<String> tracePropagationTargets =
335323
readList(metadata, logger, TRACE_PROPAGATION_TARGETS);
336324

337-
// TODO [MAJOR] remove once TRACING_ORIGINS have been removed
338-
if (!metadata.containsKey(TRACE_PROPAGATION_TARGETS)
339-
&& (tracePropagationTargets == null || tracePropagationTargets.isEmpty())) {
340-
tracePropagationTargets = readList(metadata, logger, TRACING_ORIGINS);
341-
}
342-
343-
if ((metadata.containsKey(TRACE_PROPAGATION_TARGETS)
344-
|| metadata.containsKey(TRACING_ORIGINS))
345-
&& tracePropagationTargets == null) {
325+
if (metadata.containsKey(TRACE_PROPAGATION_TARGETS) && tracePropagationTargets == null) {
346326
options.setTracePropagationTargets(Collections.emptyList());
347327
} else if (tracePropagationTargets != null) {
348328
options.setTracePropagationTargets(tracePropagationTargets);

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -337,27 +337,6 @@ public void enableAllAutoBreadcrumbs(boolean enable) {
337337
setEnableUserInteractionBreadcrumbs(enable);
338338
}
339339

340-
/**
341-
* Returns the interval for profiling traces in milliseconds.
342-
*
343-
* @return the interval for profiling traces in milliseconds.
344-
* @deprecated has no effect and will be removed in future versions. It now just returns 0.
345-
*/
346-
@Deprecated
347-
@SuppressWarnings("InlineMeSuggester")
348-
public int getProfilingTracesIntervalMillis() {
349-
return 0;
350-
}
351-
352-
/**
353-
* Sets the interval for profiling traces in milliseconds.
354-
*
355-
* @param profilingTracesIntervalMillis - the interval for profiling traces in milliseconds.
356-
* @deprecated has no effect and will be removed in future versions.
357-
*/
358-
@Deprecated
359-
public void setProfilingTracesIntervalMillis(final int profilingTracesIntervalMillis) {}
360-
361340
/**
362341
* Returns the Debug image loader
363342
*

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -336,16 +336,6 @@ class AndroidTransactionProfilerTest {
336336
assertEquals(0, profiler.transactionsCounter)
337337
}
338338

339-
@Test
340-
fun `profiler ignores profilingTracesIntervalMillis`() {
341-
fixture.options.apply {
342-
profilingTracesIntervalMillis = 0
343-
}
344-
val profiler = fixture.getSut(context)
345-
profiler.start()
346-
assertEquals(1, profiler.transactionsCounter)
347-
}
348-
349339
@Test
350340
fun `profiler never use background threads`() {
351341
val profiler = fixture.getSut(context)

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,12 +493,11 @@ class DefaultAndroidEventProcessorTest {
493493
}
494494

495495
@Test
496-
fun `Event sets language and locale`() {
496+
fun `Event sets locale`() {
497497
val sut = fixture.getSut(context)
498498

499499
assertNotNull(sut.process(SentryEvent(), Hint())) {
500500
val device = it.contexts.device!!
501-
assertEquals("en", device.language)
502501
assertEquals("en_US", device.locale)
503502
}
504503
}

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

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,6 @@ class ManifestMetadataReaderTest {
106106
assertNull(fixture.options.sampleRate)
107107
}
108108

109-
@Test
110-
fun `applyMetadata reads session tracking to options`() {
111-
// Arrange
112-
val bundle = bundleOf(ManifestMetadataReader.SESSION_TRACKING_ENABLE to false)
113-
val context = fixture.getContext(metaData = bundle)
114-
115-
// Act
116-
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)
117-
118-
// Assert
119-
assertFalse(fixture.options.isEnableAutoSessionTracking)
120-
}
121-
122109
@Test
123110
fun `applyMetadata reads session tracking and keep default value if not found`() {
124111
// Arrange
@@ -747,31 +734,6 @@ class ManifestMetadataReaderTest {
747734
assertTrue(fixture.options.isTraceSampling)
748735
}
749736

750-
@Test
751-
fun `applyMetadata reads enableTracesProfiling to options`() {
752-
// Arrange
753-
val bundle = bundleOf(ManifestMetadataReader.TRACES_PROFILING_ENABLE to true)
754-
val context = fixture.getContext(metaData = bundle)
755-
756-
// Act
757-
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)
758-
759-
// Assert
760-
assertTrue(fixture.options.isProfilingEnabled)
761-
}
762-
763-
@Test
764-
fun `applyMetadata reads enableTracesProfiling to options and keeps default`() {
765-
// Arrange
766-
val context = fixture.getContext()
767-
768-
// Act
769-
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)
770-
771-
// Assert
772-
assertFalse(fixture.options.isProfilingEnabled)
773-
}
774-
775737
@Test
776738
fun `applyMetadata reads profilesSampleRate from metadata`() {
777739
// Arrange
@@ -826,67 +788,6 @@ class ManifestMetadataReaderTest {
826788
assertEquals(listOf("localhost", """^(http|https)://api\..*$"""), fixture.options.tracePropagationTargets)
827789
}
828790

829-
@Test
830-
fun `applyMetadata ignores tracingOrigins if tracePropagationTargets is present`() {
831-
// Arrange
832-
val bundle = bundleOf(
833-
ManifestMetadataReader.TRACE_PROPAGATION_TARGETS to """localhost,^(http|https)://api\..*$""",
834-
ManifestMetadataReader.TRACING_ORIGINS to """otherhost"""
835-
)
836-
val context = fixture.getContext(metaData = bundle)
837-
838-
// Act
839-
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)
840-
841-
// Assert
842-
assertEquals(listOf("localhost", """^(http|https)://api\..*$"""), fixture.options.tracePropagationTargets)
843-
}
844-
845-
@Test
846-
fun `applyMetadata ignores tracingOrigins if tracePropagationTargets is present even if null`() {
847-
// Arrange
848-
val bundle = bundleOf(
849-
ManifestMetadataReader.TRACE_PROPAGATION_TARGETS to null,
850-
ManifestMetadataReader.TRACING_ORIGINS to """otherhost"""
851-
)
852-
val context = fixture.getContext(metaData = bundle)
853-
854-
// Act
855-
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)
856-
857-
// Assert
858-
assertTrue(fixture.options.tracePropagationTargets.isEmpty())
859-
}
860-
861-
@Test
862-
fun `applyMetadata ignores tracingOrigins if tracePropagationTargets is present even if empty string`() {
863-
// Arrange
864-
val bundle = bundleOf(
865-
ManifestMetadataReader.TRACE_PROPAGATION_TARGETS to "",
866-
ManifestMetadataReader.TRACING_ORIGINS to """otherhost"""
867-
)
868-
val context = fixture.getContext(metaData = bundle)
869-
870-
// Act
871-
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)
872-
873-
// Assert
874-
assertTrue(fixture.options.tracePropagationTargets.isEmpty())
875-
}
876-
877-
@Test
878-
fun `applyMetadata uses tracingOrigins if tracePropagationTargets is not present`() {
879-
// Arrange
880-
val bundle = bundleOf(ManifestMetadataReader.TRACING_ORIGINS to """otherhost""")
881-
val context = fixture.getContext(metaData = bundle)
882-
883-
// Act
884-
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)
885-
886-
// Assert
887-
assertEquals(listOf("otherhost"), fixture.options.tracePropagationTargets)
888-
}
889-
890791
@Test
891792
fun `applyMetadata reads null tracePropagationTargets and sets empty list`() {
892793
// Arrange

sentry-graphql-core/api/sentry-graphql-core.api

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ public final class io/sentry/graphql/NoOpSubscriptionHandler : io/sentry/graphql
3030
public fun onSubscriptionResult (Ljava/lang/Object;Lio/sentry/IScopes;Lio/sentry/graphql/ExceptionReporter;Lgraphql/execution/instrumentation/parameters/InstrumentationFieldFetchParameters;)Ljava/lang/Object;
3131
}
3232

33-
public final class io/sentry/graphql/SentryDataFetcherExceptionHandler : graphql/execution/DataFetcherExceptionHandler {
34-
public fun <init> (Lgraphql/execution/DataFetcherExceptionHandler;)V
35-
public fun <init> (Lio/sentry/IScopes;Lgraphql/execution/DataFetcherExceptionHandler;)V
36-
public fun handleException (Lgraphql/execution/DataFetcherExceptionHandlerParameters;)Ljava/util/concurrent/CompletableFuture;
37-
public fun onException (Lgraphql/execution/DataFetcherExceptionHandlerParameters;)Lgraphql/execution/DataFetcherExceptionHandlerResult;
38-
}
39-
4033
public final class io/sentry/graphql/SentryGenericDataFetcherExceptionHandler : graphql/execution/DataFetcherExceptionHandler {
4134
public fun <init> (Lgraphql/execution/DataFetcherExceptionHandler;)V
4235
public fun <init> (Lio/sentry/IScopes;Lgraphql/execution/DataFetcherExceptionHandler;)V

0 commit comments

Comments
 (0)