sentry-java
sentry-java copied to clipboard
Create spans from the transaction root instead of latest active span
We've decided that automatically created spans should be a child of the root transaction. It'll be a flat list of spans but the timeline is still correct due to the timestamps.
On Cocoa, https://github.com/getsentry/sentry-cocoa/issues/1215 was already closed to keep creating automatic spans from the root.
This is only necessary for Mobile integrations since they have the concept of singleHub, backend instrumentation does not require that since each thread has its own hub/scope.
We don't think its a breaking change since this public API does not change, the chart timeline does not change, but only the hierarchical view of the spans.
cc @bruno-garcia
example: https://github.com/getsentry/sentry-java/blob/main/sentry-android-fragment/src/main/java/io/sentry/android/fragment/SentryFragmentLifecycleCallbacks.kt#L134-L140
I think we should change this asap. It looks suboptimal, like 1 HTTP requests triggers the other one.
More importantly I believe this will trigger some N+1 issue false positive in the future
Closing this one in favor of https://github.com/getsentry/sentry-java/issues/1828