Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag all spans with thread info #2505

Open
Tracked by #153
buenaflor opened this issue Dec 16, 2024 · 4 comments
Open
Tracked by #153

Tag all spans with thread info #2505

buenaflor opened this issue Dec 16, 2024 · 4 comments

Comments

@buenaflor
Copy link
Contributor

buenaflor commented Dec 16, 2024

Description

Issue: getsentry/team-mobile#153

We can use rootIsolateToken but this is currently blocked by Flutter min version 3.7

@ueman
Copy link
Collaborator

ueman commented Dec 16, 2024

You can also use Isolate.debugName, which has no such limitation. It's also not specific to Flutter, but to dart:io. But then again rootIsolateToken is also bound to dart:io and web has no threads.

@buenaflor
Copy link
Contributor Author

buenaflor commented Dec 16, 2024

Main reason why I don't necessarily want to use it is because it's mutable

PlatformDispatcher.instance.setIsolateDebugName(...)

unlikely that someone does that but it could lead to some unwanted results

in any case, we're planning on bumping the dart version quite a bit in v9 so this shouldn't really be an issue there

@ueman
Copy link
Collaborator

ueman commented Dec 16, 2024

rootIsolateToken on the other hand is non-null on the main-isolate vs null on non-main-isolates. So it has less information than Isolate.debugName. (Not saying that one is better, just that each has their own drawbacks)

@buenaflor
Copy link
Contributor Author

buenaflor commented Dec 16, 2024

we could verify that the current Isolate is in the main isolate or not with rootIsolateToken and then we know that the Isolate.current.debugName is referring to the main isolate and not any other and use it then properly

these are only edge cases though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Blocked
Development

No branches or pull requests

2 participants