-
Notifications
You must be signed in to change notification settings - Fork 407
fix(tracer): preserve wrapped function metadata #10133
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,8 +118,9 @@ class DatadogTracer extends Tracer { | |
|
|
||
| wrap (name, options, fn) { | ||
| const tracer = this | ||
| const shimmer = require('../../datadog-shimmer') | ||
|
|
||
| return function (...args) { | ||
| return shimmer.wrapFunction(fn, original => function (...args) { | ||
|
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.
When the newly supported four-argument Express error middleware handles the response without calling Useful? React with 👍 / 👎.
Member
Author
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. This is a pre existing issue as it seems. That should be handled separately 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.
When Useful? React with 👍 / 👎.
Member
Author
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. This seems to be a pre-existing issue that is something that should be fixed independently |
||
| let optionsObj = options | ||
| if (typeof optionsObj === 'function' && typeof fn === 'function') { | ||
| optionsObj = optionsObj.apply(this, args) | ||
|
|
@@ -136,11 +137,11 @@ class DatadogTracer extends Tracer { | |
| return scopeBoundCb.apply(this, arguments) | ||
| } | ||
|
|
||
| return fn.apply(this, args) | ||
| return original.apply(this, args) | ||
| }) | ||
| } | ||
| return tracer.trace(name, optionsObj, () => fn.apply(this, args)) | ||
| } | ||
| return tracer.trace(name, optionsObj, () => original.apply(this, args)) | ||
| }) | ||
| } | ||
|
|
||
| setUrl (url) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.