sentry-dart
sentry-dart copied to clipboard
Trace transactions across isolates
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.
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 Thanks for that workaround!
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.
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.