Skip to content

Commit 8a93fec

Browse files
authored
Merge branch '8.x.x' into feat/lazy-span-id-v8
2 parents e6df0ad + 2a08014 commit 8a93fec

File tree

137 files changed

+177
-5640
lines changed

Some content is hidden

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

137 files changed

+177
-5640
lines changed

CHANGELOG.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,31 @@
55
### Breaking Changes
66

77
- Throw IllegalArgumentException when calling Sentry.init on Android ([#3596](https://github.com/getsentry/sentry-java/pull/3596))
8+
- Metrics have been removed from the SDK ([#3774](https://github.com/getsentry/sentry-java/pull/3774))
9+
- Metrics will return but we don't know in what exact form yet
10+
- `enableTracing` option (a.k.a `enable-tracing`) has been removed from the SDK ([#3776](https://github.com/getsentry/sentry-java/pull/3776))
11+
- Please set `tracesSampleRate` to a value >= 0.0 for enabling performance instead. The default value is `null` which means performance is disabled.
812
- Change OkHttp sub-spans to span attributes ([#3556](https://github.com/getsentry/sentry-java/pull/3556))
913
- This will reduce the number of spans created by the SDK
1014
- `options.experimental.sessionReplay.errorSampleRate` was renamed to `options.experimental.sessionReplay.onErrorSampleRate` ([#3637](https://github.com/getsentry/sentry-java/pull/3637))
1115
- 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))
1216
- Replace `synchronized` methods and blocks with `ReentrantLock` (`AutoClosableReentrantLock`) ([#3715](https://github.com/getsentry/sentry-java/pull/3715))
1317
- 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.
14-
- `traceHeaders` method has been removed ([#3718](https://github.com/getsentry/sentry-java/pull/3718))
15-
- `reportFullDisplayed` method has been removed ([#3717](https://github.com/getsentry/sentry-java/pull/3717))
16-
- 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))
1733

1834
### Features
1935

@@ -23,12 +39,13 @@
2339
- Use `<meta-data android:name="io.sentry.force-init" android:value="true" />` to ensure Sentry Android auto init is not easily overwritten
2440
- Attach request body for `application/x-www-form-urlencoded` requests in Spring ([#3731](https://github.com/getsentry/sentry-java/pull/3731))
2541
- Previously request body was only attached for `application/json` requests
26-
- Lazy uuid generation for SentryId and SpanId ([#3770](https://github.com/getsentry/sentry-java/pull/3770))
42+
- Set breadcrumb level based on http status ([#3771](https://github.com/getsentry/sentry-java/pull/3771))
2743
- Support `graphql-java` v22 via a new module `sentry-graphql-22` ([#3740](https://github.com/getsentry/sentry-java/pull/3740))
2844
- If you are using `graphql-java` v21 or earlier, you can use the `sentry-graphql` module
2945
- For `graphql-java` v22 and newer please use the `sentry-graphql-22` module
3046
- We now provide a `SentryInstrumenter` bean directly for Spring (Boot) if there is none yet instead of using `GraphQlSourceBuilderCustomizer` to add the instrumentation ([#3744](https://github.com/getsentry/sentry-java/pull/3744))
3147
- It is now also possible to provide a bean of type `SentryGraphqlInstrumentation.BeforeSpanCallback` which is then used by `SentryInstrumenter`
48+
- Lazy uuid generation for SentryId and SpanId ([#3770](https://github.com/getsentry/sentry-java/pull/3770))
3249

3350
### Fixes
3451

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 & 36 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";
@@ -57,7 +54,6 @@ final class ManifestMetadataReader {
5754
static final String UNCAUGHT_EXCEPTION_HANDLER_ENABLE =
5855
"io.sentry.uncaught-exception-handler.enable";
5956

60-
static final String TRACING_ENABLE = "io.sentry.traces.enable";
6157
static final String TRACES_SAMPLE_RATE = "io.sentry.traces.sample-rate";
6258
static final String TRACES_ACTIVITY_ENABLE = "io.sentry.traces.activity.enable";
6359
static final String TRACES_ACTIVITY_AUTO_FINISH_ENABLE =
@@ -66,14 +62,9 @@ final class ManifestMetadataReader {
6662

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

69-
static final String TRACES_PROFILING_ENABLE = "io.sentry.traces.profiling.enable";
7065
static final String PROFILES_SAMPLE_RATE = "io.sentry.traces.profiling.sample-rate";
7166

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

7970
static final String ATTACH_THREADS = "io.sentry.attach-threads";
@@ -103,8 +94,6 @@ final class ManifestMetadataReader {
10394

10495
static final String ENABLE_SCOPE_PERSISTENCE = "io.sentry.enable-scope-persistence";
10596

106-
static final String ENABLE_METRICS = "io.sentry.enable-metrics";
107-
10897
static final String REPLAYS_SESSION_SAMPLE_RATE = "io.sentry.session-replay.session-sample-rate";
10998

11099
static final String REPLAYS_ERROR_SAMPLE_RATE = "io.sentry.session-replay.on-error-sample-rate";
@@ -153,14 +142,13 @@ static void applyMetadata(
153142

154143
options.setAnrEnabled(readBool(metadata, logger, ANR_ENABLE, options.isAnrEnabled()));
155144

156-
// deprecated
157-
final boolean enableSessionTracking =
158-
readBool(
159-
metadata, logger, SESSION_TRACKING_ENABLE, options.isEnableAutoSessionTracking());
160-
161145
// use enableAutoSessionTracking as fallback
162146
options.setEnableAutoSessionTracking(
163-
readBool(metadata, logger, AUTO_SESSION_TRACKING_ENABLE, enableSessionTracking));
147+
readBool(
148+
metadata,
149+
logger,
150+
AUTO_SESSION_TRACKING_ENABLE,
151+
options.isEnableAutoSessionTracking()));
164152

165153
if (options.getSampleRate() == null) {
166154
final Double sampleRate = readDouble(metadata, logger, SAMPLE_RATE);
@@ -288,10 +276,6 @@ static void applyMetadata(
288276
COLLECT_ADDITIONAL_CONTEXT,
289277
options.isCollectAdditionalContext()));
290278

291-
if (options.getEnableTracing() == null) {
292-
options.setEnableTracing(readBoolNullable(metadata, logger, TRACING_ENABLE, null));
293-
}
294-
295279
if (options.getTracesSampleRate() == null) {
296280
final Double tracesSampleRate = readDouble(metadata, logger, TRACES_SAMPLE_RATE);
297281
if (tracesSampleRate != -1) {
@@ -316,9 +300,6 @@ static void applyMetadata(
316300
TRACES_ACTIVITY_AUTO_FINISH_ENABLE,
317301
options.isEnableActivityLifecycleTracingAutoFinish()));
318302

319-
options.setProfilingEnabled(
320-
readBool(metadata, logger, TRACES_PROFILING_ENABLE, options.isProfilingEnabled()));
321-
322303
if (options.getProfilesSampleRate() == null) {
323304
final Double profilesSampleRate = readDouble(metadata, logger, PROFILES_SAMPLE_RATE);
324305
if (profilesSampleRate != -1) {
@@ -341,15 +322,7 @@ static void applyMetadata(
341322
List<String> tracePropagationTargets =
342323
readList(metadata, logger, TRACE_PROPAGATION_TARGETS);
343324

344-
// TODO [MAJOR] remove once TRACING_ORIGINS have been removed
345-
if (!metadata.containsKey(TRACE_PROPAGATION_TARGETS)
346-
&& (tracePropagationTargets == null || tracePropagationTargets.isEmpty())) {
347-
tracePropagationTargets = readList(metadata, logger, TRACING_ORIGINS);
348-
}
349-
350-
if ((metadata.containsKey(TRACE_PROPAGATION_TARGETS)
351-
|| metadata.containsKey(TRACING_ORIGINS))
352-
&& tracePropagationTargets == null) {
325+
if (metadata.containsKey(TRACE_PROPAGATION_TARGETS) && tracePropagationTargets == null) {
353326
options.setTracePropagationTargets(Collections.emptyList());
354327
} else if (tracePropagationTargets != null) {
355328
options.setTracePropagationTargets(tracePropagationTargets);
@@ -398,9 +371,6 @@ static void applyMetadata(
398371
readBool(
399372
metadata, logger, ENABLE_SCOPE_PERSISTENCE, options.isEnableScopePersistence()));
400373

401-
options.setEnableMetrics(
402-
readBool(metadata, logger, ENABLE_METRICS, options.isEnableMetrics()));
403-
404374
if (options.getExperimental().getSessionReplay().getSessionSampleRate() == null) {
405375
final Double sessionSampleRate =
406376
readDouble(metadata, logger, REPLAYS_SESSION_SAMPLE_RATE);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ private static SentrySpan timeSpanToSentrySpan(
339339
APP_METRICS_ORIGIN,
340340
new ConcurrentHashMap<>(),
341341
new ConcurrentHashMap<>(),
342-
null,
343342
defaultSpanData);
344343
}
345344

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

Lines changed: 2 additions & 23 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>
@@ -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/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/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
}

0 commit comments

Comments
 (0)