function wrappedHandler(...args) {
      const transaction = shim.tracer.getTransaction()
      if (!transaction) {
        logger.trace('No active transaction, not wrapping handler')
        return handler.apply(this, args)
      }

      const event = args[0]
      const context = args[1]
      logger.trace('Lambda function name', context?.functionName)
      const isApiGatewayLambdaProxy = apiGateway.isLambdaProxyEvent(event)
      logger.trace('Is this Lambda event an API Gateway or ALB web proxy?', isApiGatewayLambdaProxy)
      logger.trace('Lambda event keys', Object.keys(event))
      const segmentRecorder = isApiGatewayLambdaProxy ? recordWeb : recordBackground
      const { segment, txnEnder } = awsLambda.createSegment({ context, event, transaction, recorder: segmentRecorder })

      // resultProcessor is used to execute additional logic based on the
      // payload supplied to the callback.
      let resultProcessor

      if (isApiGatewayLambdaProxy) {
        const webRequest = new apiGateway.LambdaProxyWebRequest(event)
        setWebRequest(shim, transaction, webRequest)
        resultProcessor = getApiGatewayLambdaProxyResultProcessor(transaction)
      }
      const cbIndex = args.length - 1
      args[cbIndex] = awsLambda.wrapCallbackAndCaptureError(
        transaction,
        txnEnder,
        args[cbIndex],
        resultProcessor
      )

      // context.{done,fail,succeed} are all considered deprecated by
      // AWS, but are considered functional.
      context.done = awsLambda.wrapCallbackAndCaptureError(transaction, txnEnder, context.done)
      context.fail = awsLambda.wrapCallbackAndCaptureError(transaction, txnEnder, context.fail)
      shim.wrap(context, 'succeed', function wrapSucceed(shim, original) {
        return function wrappedSucceed() {
          txnEnder()
          return original.apply(this, arguments)
        }
      })

      let res
      try {
        res = shim.applySegment(handler, segment, false, this, args)
      } catch (err) {
        uncaughtException = err
        txnEnder()
        throw err
      }
      if (shim.isPromise(res)) {
        res = lambdaInterceptPromise(res, resultProcessor, txnEnder)
      }
      return res
    }
Wraps a non response streaming lambda handler.

Creates and applies segment based on function name, assigns attributes to transaction trace,
adds handlers if api gateway to wrap request/response
wraps the callback(if present), wraps the context `done`, `succeed`, `fail methods`, intercepts promise
and properly ends transaction
@param {...any} args