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

      const event = args[0]
      const context = args[2]
      logger.trace('In stream handler, lambda function name', context?.functionName)
      const { segment, txnEnder } = awsLambda.createSegment({ context, event, transaction, recorder: recordBackground })
      args[1] = awsLambda.wrapStreamAndCaptureError(
        transaction,
        txnEnder,
        args[1]
      )

      let res
      try {
        res = shim.applySegment(handler, segment, false, this, args)
      } catch (err) {
        uncaughtException = err
        txnEnder()
        throw err
      }

      return res
    }
Wraps a response streaming lambda handler.

Creates and applies segment based on function name, assigns attributes to transaction trace,
listen when stream errors(log error), ends(end transaction)

**Note**: AWS doesn't support response streaming with API gateway invoked lambdas.
This means we do not handle that as it would require intercepting the stream to parse
the response code and headers.
@param {...any} args