function wrapConnect(shim, amqp, promiseMode) {
  shim.wrap(amqp, 'connect', function wrapConnect(shim, connect) {
    return function wrappedConnect(...args) {
      const [connArgs] = args
      const params = parseConnectionArgs({ shim, connArgs })
      const cb = args[args.length - 1]
      if (!promiseMode) {
        args[args.length - 1] = function wrappedCallback(...cbArgs) {
          const [, c] = cbArgs
          c.connection[amqpConnection] = params
          return cb.apply(this, cbArgs)
        }
      }

      const result = connect.apply(this, args)
      if (promiseMode) {
        return result.then((c) => {
          c.connection[amqpConnection] = params
          return c
        })
      }
      return result
    }
  })

  shim.record(amqp, 'connect', function recordConnect(shim, connect, name, args) {
    const [connArgs] = args
    const params = parseConnectionArgs({ shim, connArgs })
    return new OperationSpec({
      name: 'amqplib.connect',
      callback: setCallback(shim, promiseMode),
      promise: promiseMode,
      parameters: new DatastoreParameters({
        host: params.host,
        port_path_or_id: params.port
      })
    })
  })
}
Instruments the connect method
We have to both wrap and record because
we need the host/port for all subsequent calls on the model/channel
but record only completes in an active transaction

@param {Shim} shim instance of shim
@param {object} amqp amqplib object
@param {boolean} promiseMode is this promise based?