-
Notifications
You must be signed in to change notification settings - Fork 534
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(express): make rpcMetadata.route capture the last layer even when if the last layer is not REQUEST_HANDLER #1620
Merged
blumamir
merged 15 commits into
open-telemetry:main
from
chigia001:fix-1618-express-rpcMetadata
Aug 13, 2023
Merged
Changes from 8 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f144c02
fix(express): make rpcMetadata.route capture the last layer even when…
chigia001 6d15f52
fix lint issue
chigia001 21a5302
Merge branch 'main' of github.com:open-telemetry/opentelemetry-js-con…
chigia001 b4f26f2
remove test.only
chigia001 259d49c
revert code to change ignore order
chigia001 1ee99d1
update test
chigia001 171763d
remove comment related to update span name
chigia001 8fefd23
Merge branch 'main' into fix-1618-express-rpcMetadata
chigia001 f54ba4c
Move rpcRoute.metadata calculation logic up
chigia001 8033026
Merge branch 'main' into fix-1618-express-rpcMetadata
chigia001 80bc054
Merge branch 'main' into fix-1618-express-rpcMetadata
chigia001 aafce10
Add more test
chigia001 32ddc04
Merge branch 'fix-1618-express-rpcMetadata' of github.com:chigia001/o…
chigia001 02eb353
Fix lint
chigia001 a5aec4a
Merge branch 'main' into fix-1618-express-rpcMetadata
chigia001 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
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
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 test should assert that the route is still captured when
This type will be set when
layer.name === 'bound dispatch'
Is using the
app.use
triggers a layer with name 'bound dispatch'?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.
#1
, the middleware that bound app.use/router.use with Router object is 'router' layer#2
isbound dispatch
, ie, route handler with HTTP method name. This is for both Express's App and Express's Router object. This is something our unit test cover most of the time. Express's route handle will match to the end of URL.#3
is the last case, IE middleware layer, where app.use/router.use have generic handler. It can be with or without the route's parameter.use
will only need to match the start of the url.Most of our test with app.use/router.use is for common's middleware use case, that don't have layername at the begining.
This new test for specificly app.use with route layer.
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.
I add additional test for these 2 case, as I don't see we have specific test for them
internally I think they are the same with case that we already cover (app.use === router.use and app.get === router.get) but just to make sure.