Skip to content

Commit

Permalink
Merge pull request newrelic#175 from newrelic/fix-paramware
Browse files Browse the repository at this point in the history
  • Loading branch information
bizob2828 authored Mar 22, 2024
2 parents 60d5f1a + 168fdf5 commit b2068d2
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions lib/instrumentation/koa/lib/router-instrumentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@ module.exports = function instrumentRouter(shim, Router) {
}

function wrapParamware(shim, paramware, fnName, route) {
return shim.recordParamware(paramware, {
name: route,
next: shim.LAST,
promise: true,
appendPath: false,
req: function getReq(shim, fn, _fnName, args) {
return args[1] && args[1].req
}
})
return shim.recordParamware(
paramware,
new shim.specs.MiddlewareSpec({
name: route,
next: shim.LAST,
promise: true,
appendPath: false,
req: function getReq(shim, fn, _fnName, args) {
return args[1] && args[1].req
}
})
)
}

function wrapMiddleware(shim, fn, name, layer) {
Expand Down

0 comments on commit b2068d2

Please sign in to comment.