-
Notifications
You must be signed in to change notification settings - Fork 213
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
chore!: Make route path as transaction name in gin performance #675
Merged
cleptric
merged 11 commits into
getsentry:master
from
antonsacred:sentry-transaction-improvement
Sep 4, 2023
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6683050
Remove http method from transaction name
2a286b0
Use gin full path as transaction name
359dd8e
Change transaction source to route
de4e6e9
Include HTTP Method into transaction name for gin
5a94ba1
Handle error in sentry gin test
ba3e92d
Merge branch 'master' into sentry-transaction-improvement
antonsacred 3b50c09
Set real path for gin transaction on 404
antonsacred c1edc11
Improve gin transaction tests with different paths for router and req…
antonsacred 26eb2af
Merge branch 'master' into sentry-transaction-improvement
antonsacred 67593bd
Choose transaction source and name depending on found route
0994233
Merge branch 'master' into sentry-transaction-improvement
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be great to test different paths, like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. c1edc11 |
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.
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.
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.
This causes issues for 404 routes, as the transaction name is now always something like
GET
.We should check for the return of
c.FullPath()
. If it's empty, usec.Request.URL.Path
as a fallback and setsentry.WithTransactionSource(sentry.SourceURL)
.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.
That's cool that you found it! Done
3b50c09
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.
@antonsacred I think what @cleptric suggests is more like, do the check and fallback here in
handle
directly (not indefer
), and set TransactionSource depending on the value ofc.FullPath()
.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.
@tonyo thanks for the take. I like your proposal. I have changed the code.