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

feat(profiling): Introduce active thread id on scope #1764

Merged
merged 4 commits into from
Dec 7, 2022

Conversation

Zylphrex
Copy link
Member

Upto this point, simply taking the current thread when the transaction/profile was started was good enough. When using ASGI apps with non async handlers, the request is received on the main thread. This is also where the transaction or profile was started. However, the request is handled on another thread using a thread pool. To support this use case, we want to be able to set the active thread id on the scope where we can read it when we need it to allow the active thread id to be set elsewhere.

Upto this point, simply taking the current thread when the transaction/profile
was started was good enough. When using ASGI apps with non async handlers, the
request is received on the main thread. This is also where the transaction or
profile was started. However, the request is handled on another thread using a
thread pool. To support this use case, we want to be able to set the active
thread id on the scope where we can read it when we need it to allow the active
thread id to be set elsewhere.
@Zylphrex Zylphrex marked this pull request as ready for review December 2, 2022 02:27
@Zylphrex Zylphrex requested review from sl0thentr0py and a team December 2, 2022 02:27
@Zylphrex
Copy link
Member Author

Zylphrex commented Dec 2, 2022

@sl0thentr0py do you know why the CI / Lint Sources job is failing? It looks unrelated to my changes.

@sl0thentr0py
Copy link
Member

@Zylphrex this was the problem, pushed fix
https://stackoverflow.com/a/58121288

@Zylphrex Zylphrex merged commit b1290c6 into master Dec 7, 2022
@Zylphrex Zylphrex deleted the txiao/feat/introduce-active-thread-id-on-scope branch December 7, 2022 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants