refactor(fastapi): use a global dependency for active thread tracking - #7826
Open
faizansaiyed123 wants to merge 31 commits into
Open
faizansaiyed123 wants to merge 31 commits into
faizansaiyed123 wants to merge 31 commits into
Conversation
faizansaiyed123
force-pushed
the
fix/7753-fastapi-global-dependency
branch
from
October 2, 2026 05:45
ffa6378 to
c428c6e
Compare
Author
|
cursor review |
Author
|
bugbot run verbose=true |
|
Bugbot request id: 8939ba6b-1511-41cb-8bd6-5514646cb90c |
Bugbot rules debugNo rules were used for this review. https://cursor.com/docs/bugbot#team-rules Bugbot request id: 8939ba6b-1511-41cb-8bd6-5514646cb90c |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1e3d9c2. Configure here.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref #7753
Follow-up to #7825.
This PR replaces FastAPI's private
routing.get_request_handlermonkey patch with an application-level global dependency.Changes:
FastAPI.__init__to register a Sentry global dependency before user-supplied global dependencies.HTTPConnectioninjection so the dependency is safe for FastAPI versions where global dependencies also apply to WebSockets.http.routesetup into the dependency, using FastAPI's effective route context when available.Dependantso synchronous endpoints update thread metadata in their actual worker thread.get_request_handlerpatch.This branch includes #7825 so it can be reviewed end-to-end. Once #7825 is merged, this PR can be rebased/simplified to the dependency-only diff.