-
Notifications
You must be signed in to change notification settings - Fork 514
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
Fix transaction name in Starlette and FastAPI #2341
Merged
antonpirker
merged 29 commits into
master
from
antonpirker/fix-transaction-name-in-starlette-and-fastapi
Sep 6, 2023
Merged
Fix transaction name in Starlette and FastAPI #2341
antonpirker
merged 29 commits into
master
from
antonpirker/fix-transaction-name-in-starlette-and-fastapi
Sep 6, 2023
Conversation
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
…up-asgi-starlette
antonpirker
changed the title
Fix transaction name in starlette and fastapi
Fix transaction name in Starlette and FastAPI
Sep 1, 2023
sentrivana
approved these changes
Sep 4, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎖️
antonpirker
deleted the
antonpirker/fix-transaction-name-in-starlette-and-fastapi
branch
September 6, 2023 07:55
sentrivana
pushed a commit
that referenced
this pull request
Sep 18, 2023
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)
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.
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.transaction_style
setting)traces_sampler
: always receives the raw URL as the transaction name (no matter thetransaction_style
setting. because we do not know more at the time the traces_sampler is called.)transaction_style
setting)transaction_style
setting)traces_sampler
: always receives the raw URL as the transaction name (no matter thetransaction_style
setting. because we do not know more at the time the traces_sampler is called.)transaction_style
setting)