From a8bce243a36bab280e095be88ed21d3b729bd2b1 Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Wed, 20 Mar 2024 11:11:18 -0400 Subject: [PATCH] chore: updated recordParamware to construct spec --- lib/router-instrumentation.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/router-instrumentation.js b/lib/router-instrumentation.js index ce6c8d7..f147ea0 100644 --- a/lib/router-instrumentation.js +++ b/lib/router-instrumentation.js @@ -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) {