You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an array of handlers is given as an argument to `server.use` instead
of just a single function, the agent would cause an exception to be
raised.
This commit changes the Restify instrumentation logic so that the
handlers no longer needs to be wrapped, and so that the arguments to the
`server.use` function no longer needs to be parsed by the agent.
Instead the agent now patches a central (private) error handling
function to be notified when ever an error is passed to the `next`
function.
The route name is instead gathered by the same logic that also gathers
the route name for Express - from `req.route.path` - as Restify just so
happens to use the same API for storing the route name on the request
object as Express in this case.
This way of getting the route name is actually more stable as the
previous implementation didn't work if the request never made it to the
actual route handler (e.g. if an error occurred in a middleware
handler). In that case the transaction would have been named `use` (the
function name used to register the middleware handler).
Fixes: #706
0 commit comments