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

Trace transactions across isolates

Open blaugold opened this issue 3 years ago • 3 comments

This is a feature that is relevant to Dart and Flutter apps.

I would like to have the ability to trace transactions that perform some work in another isolate and therefore create child spans in that second isolate.

The TimelineTask from dart:developer for example can be used to track tasks that have child tasks in multiple isolates.

blaugold avatar Jan 26 '22 19:01 blaugold

Indeed, for now, there's a workaround.

// your span Isolate A final header = spanIsolateA.toSentryTrace()

// pass header to Isolate B You can use the final spanIsolateB = Sentry.startTransactionWithContext(SentryTransactionContext.fromSentryTrace(header)).

So you are able to continue a transaction from different contexts, that's used for Frontend and Backend stuff, but it works.

marandaneto avatar Jan 27 '22 11:01 marandaneto

@marandaneto Thanks for that workaround!

blaugold avatar Jan 27 '22 12:01 blaugold

We'll do an investigation on how this class Timeline task works and how we could use that to our benefit. Users could benefit from creating fine-grained spans out of the given transaction/span. We'll write an update as soon as we come to it.

marandaneto avatar Mar 03 '22 14:03 marandaneto

Closing it in favor of https://github.com/getsentry/sentry-dart/issues/1343 Not really the very same thing but the very same symptom. I believe we can address both together.

marandaneto avatar Mar 17 '23 13:03 marandaneto