fix(fastapi): use effective_route_context path for prefixed routers by ericapisani · Pull Request #6572 · getsentry/sentry-python
The fix handles the case where FastAPI >= 0.137 stores the
prefix-resolved path in scope["fastapi"]["effective_route_context"] instead of scope["route"].path, so transactions/segments now show the full /api/users/{user_id} path instead of the unprefixed
/users/{user_id}.
Additionally, in the case of the `strawberry` framework without a specified path, this would fallback to using `generic FastAPI request` instead of using the prefix provided in the router (like `graphql` in the test cases.
Fixes PY-2530
Fixes #6571
Bot
reviewed
ericapisani
deleted the
py-2530-fastapi-strawberry-tox-fix
branch
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