function loadInstrumentation({ shim, resolvedNodule, moduleName, nodule, instrumentation }) {
  const trackedItem = shimmer.registeredInstrumentations.getTrackedItem(moduleName, instrumentation)
  try {
    if (instrumentation.onRequire(shim, resolvedNodule, moduleName) !== false) {
      shimmer.registeredInstrumentations.setHookSuccess(trackedItem)
      nodule = shim.getExport(nodule)
    }
  } catch (instrumentationError) {
    shimmer.registeredInstrumentations.setHookFailure(trackedItem)
    if (instrumentation.onError) {
      try {
        instrumentation.onError(instrumentationError)
      } catch (e) {
        logger.warn(
          e,
          instrumentationError,
          'Custom instrumentation for %s failed, then the onError handler threw an error',
          moduleName
        )
      }
    } else {
      logger.warn(
        instrumentationError,
        'Custom instrumentation for %s failed. Please report this to the ' +
          'maintainers of the custom instrumentation.',
        moduleName
      )
    }
  }

  return nodule
}
Attempts to execute an onRequire hook for a given module.
If it fails it will call an onError hook and log warnings accordingly

@param {object} params wrapping object to function
@param {*} params.shim The instance of the shim used to instrument the module.
@param {object} params.nodule Class or module containing the function to wrap.
@param {object} params.resolvedNodule returns export of the default property
@param {string} params.moduleName module name
@param {InstrumentationDescriptor} params.instrumentation hooks for a give module
@returns {object} updated export module