-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix transaction name in Starlette and FastAPI (#2341)
Set the url as a transaction name instead of 'generic ASGI request' in the beginning, so traces_sampler has something to work with that is more meaningful than 'generic ASGI request'. Closes #2262 Closes #2263 New Behaviour: Note: transaction names can be two styles, "url" or "endpoint". (set by the transaction_style parameter of the Integrations) Note 2: See also @pytest.mark.parametrize decorator in the new tests as reference. vanilla ASGI: set URL instead of always "generic ASGI request" Starlette: normal request: transaction name is function name or route (depending on transaction_style setting) traces_sampler: always receives the raw URL as the transaction name (no matter the transaction_style setting. because we do not know more at the time the traces_sampler is called.) requests that end in a middleware (like 404, CORS): the functions name or the raw URL (depending on transaction_style setting) FastAPI normal request: transaction name is function name or route (depending on transaction_style setting) traces_sampler: always receives the raw URL as the transaction name (no matter the transaction_style setting. because we do not know more at the time the traces_sampler is called.) requests that end in a middleware (like 404, CORS): the functions name or the raw URL (depending on transaction_style setting) There used to be "generic ASGI request" transactions being created at the server startup (when a "lifespan" ASGI message was received.) Those transactions are not created anymore. (we can think of creating propper "Server was started/stopped" transactions in the future)
- Loading branch information
1 parent
ba6de38
commit 80cd1f1
Showing
5 changed files
with
564 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.