File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -428,9 +428,12 @@ class Tracer extends Utility implements TracerInterface {
428428 const tracerRef = this ;
429429 // Use a function() {} instead of an () => {} arrow function so that we can
430430 // access `myClass` as `this` in a decorated `myClass.myMethod()`.
431- descriptor . value = function ( this : Handler , event , context , callback ) {
431+ descriptor . value = function (
432+ this : Handler ,
433+ ...args : Parameters < Handler >
434+ ) {
432435 if ( ! tracerRef . isTracingEnabled ( ) ) {
433- return originalMethod . apply ( this , [ event , context , callback ] ) ;
436+ return originalMethod . apply ( this , args ) ;
434437 }
435438
436439 return tracerRef . provider . captureAsyncFunc (
@@ -440,11 +443,7 @@ class Tracer extends Utility implements TracerInterface {
440443 tracerRef . addServiceNameAnnotation ( ) ;
441444 let result : unknown ;
442445 try {
443- result = await originalMethod . apply ( this , [
444- event ,
445- context ,
446- callback ,
447- ] ) ;
446+ result = await originalMethod . apply ( this , args ) ;
448447 if ( options ?. captureResponse ?? true ) {
449448 tracerRef . addResponseAsMetadata ( result , process . env . _HANDLER ) ;
450449 }
You can’t perform that action at this time.
0 commit comments