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

Create spans from the transaction root instead of latest active span

Open marandaneto opened this issue 3 years ago • 4 comments

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.

marandaneto avatar Dec 06 '21 10:12 marandaneto

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.

marandaneto avatar Dec 06 '21 10:12 marandaneto

cc @bruno-garcia

marandaneto avatar Dec 06 '21 10:12 marandaneto

example: https://github.com/getsentry/sentry-java/blob/main/sentry-android-fragment/src/main/java/io/sentry/android/fragment/SentryFragmentLifecycleCallbacks.kt#L134-L140

marandaneto avatar Dec 14 '21 10:12 marandaneto

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

bruno-garcia avatar Jun 14 '22 19:06 bruno-garcia

Closing this one in favor of https://github.com/getsentry/sentry-java/issues/1828

markushi avatar Feb 01 '23 15:02 markushi