-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat: added support for express v5 beta #1261
Conversation
methods.concat('all').forEach(method => { | ||
if (typeof express.Route.prototype[method] === 'function') { | ||
shimmer.wrap(express.Route.prototype, method, shimHandlerRegistration); | ||
} | ||
}); | ||
} | ||
if (express.Router && express.Router.prototype) { |
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.
In express v5 beta, the routing logic has been refactored to use the router module instead of a locally defined one. The methods to capture uncaught errors are now on the prototype of express.Router. This ensures the code correctly wraps and intercepts the handle and use methods in Express 5 beta for error capturing.
reference expressjs/express@cec5780
7e69906
to
ffe9145
Compare
packages/core/src/tracing/instrumentation/frameworks/express.js
Outdated
Show resolved
Hide resolved
packages/core/src/tracing/instrumentation/frameworks/express.js
Outdated
Show resolved
Hide resolved
a6e6368
to
0edeb63
Compare
packages/collector/test/tracing/frameworks/express_uncaught_errors/app.js
Show resolved
Hide resolved
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
I think this is good enough for now as we have proven that most of the use cases work.
Follow up tickets:
- Currency report (asap)
- Move test env to express 5 (no specific date. We will til v5 comes out)
- Add express v5 support when it comes out (same as 2.)
0edeb63
to
68e05d1
Compare
Express has been preparing for a major release (v5) for some time now, and they have already released several beta versions, including 5.0.0-beta.3.
This PR is intended to add support for the latest express v5 beta version 5.0.0-beta.3.
More details are in #1249
refs INSTA-11745