You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix transaction name in Starlette and FastAPI (getsentry#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'.
Closesgetsentry#2262Closesgetsentry#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)
0 commit comments