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

Allow traverse span tree

Open stefanosiano opened this issue 3 months ago • 3 comments

Description

Should we provide an easy way to get the parent of a span (or directly the root span/transaction)?

This was asked by a customer who wants to attach custom spans to ui.load spans

stefanosiano avatar Sep 02 '25 15:09 stefanosiano

Getting the current transaction should already be possible with Sentry.configureScope(scope -> scope.getTransaction());, maybe this is sufficient already.

lcian avatar Sep 02 '25 16:09 lcian

Let's discuss this topic on a broader level, maybe we have some platforms which already expose APIs like the requested one.

markushi avatar Sep 03 '25 13:09 markushi