function instrumentPostLoad(agent, nodule, moduleName, resolvedName, esmResolver) {
  // default to Node.js version, this occurs for core libraries
  const pkgVersion = shimmer.getPackageVersion(moduleName)
  const trackedInstrumentations = shimmer.registeredInstrumentations.getAllByName(moduleName)
  trackedInstrumentations.forEach((trackedInstrumentation) => {
    const isInstrumented = trackedInstrumentation.meta.instrumented === true
    const failedInstrumentation = trackedInstrumentation.meta.didError === true
    if (isInstrumented === true || failedInstrumentation === true) {
      const msg = isInstrumented ? 'Already instrumented' : 'Failed to instrument'
      logger.trace(`${msg} ${moduleName}@${pkgVersion}, skipping registering instrumentation`)
      return
    }

    const { instrumentation } = trackedInstrumentation
    const resolvedNodule = resolveNodule({ nodule, instrumentation, esmResolver })
    const shim = shims.createShimFromType({
      type: instrumentation.type,
      agent,
      moduleName,
      resolvedName,
      shimName: instrumentation.shimName,
      pkgVersion
    })

    applyDebugState(shim, resolvedNodule, esmResolver)
    trackInstrumentationUsage(agent, shim, moduleName, NAMES.FEATURES.INSTRUMENTATION.ON_REQUIRE)

    // Tracking instrumentation is only used to add the supportability metrics
    // that occur directly above this.  No reason to attempt to load instrumentation
    // as it does not exist.
    if (instrumentation.type === InstrumentationDescriptor.TYPE_TRACKING) {
      shimmer.registeredInstrumentations.setHookSuccess(trackedInstrumentation)
      return
    }

    nodule = loadInstrumentation({
      shim,
      resolvedNodule,
      pkgVersion,
      moduleName,
      nodule,
      instrumentation
    })
  })

  return nodule
}
All instrumentation files must export the same interface: a single
initialization function that takes the agent and the module to be
instrumented.

@param {object} agent NR agent
@param {object} nodule Class or module containing the function to wrap.
@param {string} moduleName name of module
@param {string} resolvedName fully qualified path to module
@param {boolean} esmResolver indicates if it came from esm loader
@returns {object|undefined} returns exported module unless already instrumented