sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Align `getSpan` method from Scope on Android/Java and iOS

Open marandaneto opened this issue 3 years ago • 1 comments

related to https://github.com/getsentry/sentry-java/issues/1827 and https://github.com/getsentry/sentry-java/issues/1822

Since they have different behavior on both platforms. on iOS it always returns the root transaction. on Android/Java it returns the latest active span.

marandaneto avatar Dec 06 '21 10:12 marandaneto

If hub is globalMode enabled, we always return the root transaction.

Doing this we don't need to do https://github.com/getsentry/sentry-java/issues/1827

This is going to break the relationship for the DB auto instrumentation, We have to create the parent span, hold the reference and create the child from it, which requires changes on the Plugin.

This is not considered a breaking change.

Next: We should talk about the thread-local storage before going forward.

marandaneto avatar Dec 15 '21 15:12 marandaneto

Closed by #2855

romtsn avatar Sep 06 '23 14:09 romtsn