Skip to content

Commit 9a12821

Browse files
committed
CR changes
1 parent a25d919 commit 9a12821

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

docs/platforms/java/migration/7.x-to-8.0.mdx

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ description: "Learn about migrating from version 7.x to 8.0.0"
1212
- `sentry-android-okhttp` has been removed in favor of `sentry-okhttp`, making the module independent from android ([#3510](https://github.com/getsentry/sentry-java/pull/3510))
1313
- Throw IllegalArgumentException when calling Sentry.init on Android ([#3596](https://github.com/getsentry/sentry-java/pull/3596))
1414
- Metrics have been removed from the SDK ([#3774](https://github.com/getsentry/sentry-java/pull/3774))
15-
- Metrics will return but we don't know in what exact form yet
15+
- Metrics will return but we don't know in what exact form yet
1616
- `enableTracing` option (a.k.a `enable-tracing`) has been removed from the SDK ([#3776](https://github.com/getsentry/sentry-java/pull/3776))
17-
- Please set `tracesSampleRate` to a value >= 0.0 for enabling performance instead. The default value is `null` which means performance is disabled.
17+
- Please set `tracesSampleRate` to a value >= 0.0 for enabling performance instead. The default value is `null` which means performance is disabled.
1818
- Change OkHttp sub-spans to span attributes ([#3556](https://github.com/getsentry/sentry-java/pull/3556))
19-
- This will reduce the number of spans created by the SDK
19+
- This will reduce the number of spans created by the SDK
2020
- Replace `synchronized` methods and blocks with `ReentrantLock` (`AutoClosableReentrantLock`) ([#3715](https://github.com/getsentry/sentry-java/pull/3715))
21-
- 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.
21+
- 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.
2222
- `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))
2323
- `profilingEnabled` option (`io.sentry.traces.profiling.enable` in manifest) has been removed, please use `profilesSampleRate` (`io.sentry.traces.profiling.sample-rate` in manifest) instead ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
24+
- Please set `profileSampleRate` to a value >= 0.0 for enabling profiling instead. The default value is `null` which means profiling is disabled.
2425
- `shutdownTimeout` option has been removed, please use `shutdownTimeoutMillis` instead ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
2526
- `profilingTracesIntervalMillis` option for Android has been removed ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
2627
- `io.sentry.session-tracking.enable` manifest option has been removed ([#3780](https://github.com/getsentry/sentry-java/pull/3780))
@@ -40,15 +41,17 @@ description: "Learn about migrating from version 7.x to 8.0.0"
4041
- The Android minSdk level for all Android modules is now 21 ([#3852](https://github.com/getsentry/sentry-java/pull/3852))
4142
- The minSdk level for sentry-android-ndk changed from 19 to 21 ([#3851](https://github.com/getsentry/sentry-java/pull/3851))
4243
- All status codes below 400 are now mapped to `SpanStatus.OK` ([#3869](https://github.com/getsentry/sentry-java/pull/3869))
44+
- `transaction.data` has moved from `extra` to `contexts.trace.data` (#3735)
45+
- If you were filtering data in e.g. `beforeSendTransaction` please update accordingly
4346

4447
### Deprecations
4548

4649
- Classes used for the previous version of the Sentry OpenTelemetry Java Agent have been deprecated (`SentrySpanProcessor`, `SentryPropagator`, `OpenTelemetryLinkErrorEventProcessor`)
4750
- `Hub` has been deprecated, we're replacing the following:
48-
- `IHub` has been replaced by `IScopes`, however you should be able to simply pass `IHub` instances to code expecting `IScopes`, allowing for an easier migration.
49-
- `HubAdapter.getInstance()` has been replaced by `ScopesAdapter.getInstance()`
50-
- The `.clone()` method on `IHub`/`IScopes` has been deprecated, please use `.pushScope()` or `.pushIsolationScope()` instead
51-
- Some internal methods like `.getCurrentHub()` and `.setCurrentHub()` have also been replaced.
51+
- `IHub` has been replaced by `IScopes`, however you should be able to simply pass `IHub` instances to code expecting `IScopes`, allowing for an easier migration.
52+
- `HubAdapter.getInstance()` has been replaced by `ScopesAdapter.getInstance()`
53+
- The `.clone()` method on `IHub`/`IScopes` has been deprecated, please use `.pushScope()` or `.pushIsolationScope()` instead
54+
- Some internal methods like `.getCurrentHub()` and `.setCurrentHub()` have also been replaced.
5255
- `Sentry.popScope` has been replaced by calling `.close()` on the token returned by `Sentry.pushScope()` and `Sentry.pushIsolationScope()`. The token can also be used in a `try-with-resource` block like this:
5356

5457
```
@@ -71,18 +74,18 @@ You may also use `LifecycleHelper.close(token)`, e.g. in case you need to pass t
7174
### Behavioral Changes
7275

7376
- We're introducing some new `Scope` types in the SDK, allowing for better control over what data is attached where. Previously there was a stack of scopes that was pushed and popped. Instead we now fork scopes for a given lifecycle and then restore the previous scopes. Since `Hub` is gone, it is also never cloned anymore. Separation of data now happens through the different scope types while making it easier to manipulate exactly what you need without having to attach data at the right time to have it apply where wanted.
74-
- Global scope is attached to all events created by the SDK. It can also be modified before `Sentry.init` has been called. It can be manipulated using `Sentry.configureScope(ScopeType.GLOBAL, (scope) -> { ... })`.
75-
- Isolation scope can be used e.g. to attach data to all events that come up while handling an incoming request. It can also be used for other isolation purposes. It can be manipulated using `Sentry.configureScope(ScopeType.ISOLATION, (scope) -> { ... })`. The SDK automatically forks isolation scope in certain cases like incoming requests, CRON jobs, Spring `@Async` and more.
76-
- Current scope is forked often and data added to it is only added to events that are created while this scope is active. Data is also passed on to newly forked child scopes but not to parents.
77+
- Global scope is attached to all events created by the SDK. It can also be modified before `Sentry.init` has been called. It can be manipulated using `Sentry.configureScope(ScopeType.GLOBAL, (scope) -> { ... })`.
78+
- Isolation scope can be used e.g. to attach data to all events that come up while handling an incoming request. It can also be used for other isolation purposes. It can be manipulated using `Sentry.configureScope(ScopeType.ISOLATION, (scope) -> { ... })`. The SDK automatically forks isolation scope in certain cases like incoming requests, CRON jobs, Spring `@Async` and more.
79+
- Current scope is forked often and data added to it is only added to events that are created while this scope is active. Data is also passed on to newly forked child scopes but not to parents.
7780
- `Sentry.popScope` has been deprecated, please call `.close()` on the token returned by `Sentry.pushScope` instead or use it in a way described in more detail in "Migration Guide".
7881
- We have chosen a default scope that is used for `Sentry.configureScope()` as well as for APIs like `Sentry.setTag()`
79-
- For Android the type defaults to `CURRENT` scope
80-
- For Backend and other JVM applicatons it defaults to `ISOLATION` scope
82+
- For Android the type defaults to `CURRENT` scope
83+
- For Backend and other JVM applicatons it defaults to `ISOLATION` scope
8184
- Event processors on `Scope` can now be ordered by overriding the `getOrder` method on implementations of `EventProcessor`. NOTE: This order only applies to event processors on `Scope` but not `SentryOptions` at the moment. Feel free to request this if you need it.
8285
- `Hub` is deprecated in favor of `Scopes`, alongside some `Hub` relevant APIs. More details can be found in the "Migration Guide" section.
8386
- (Android) The JNI layer for sentry-native has now been moved from sentry-java to sentry-native ([#3189](https://github.com/getsentry/sentry-java/pull/3189))
84-
- This now includes prefab support for sentry-native, allowing you to link and access the sentry-native API within your native app code
85-
- Checkout the `sentry-samples/sentry-samples-android` example on how to configure CMake and consume `sentry.h`
87+
- This now includes prefab support for sentry-native, allowing you to link and access the sentry-native API within your native app code
88+
- Checkout the `sentry-samples/sentry-samples-android` example on how to configure CMake and consume `sentry.h`
8689
- (Android) Replace thread id with kernel thread id in span data ([#3706](https://github.com/getsentry/sentry-java/pull/3706))
8790
- (Android) Enable Performance V2 by default ([#3824](https://github.com/getsentry/sentry-java/pull/3824))
8891
- With this change cold app start spans will include spans for ContentProviders, Application and Activity load.
@@ -117,3 +120,5 @@ Sentry.init(options -> {
117120
```
118121

119122
If you're using our Spring Boot integration, it will automatically detect our OpenTelemetry agent and take care of configuring the SDK for you.
123+
124+
We've added more sample applications that showcase how to combine Sentry and OpenTelemetry (https://github.com/getsentry/sentry-java/tree/8.x.x/sentry-samples).

0 commit comments

Comments
 (0)