setResolvedName(moduleName, resolvedName) {
    const items = this.#tracked.get(moduleName)
    if (items === undefined) {
      throw Error(`module not tracked: ${moduleName}`)
    }

    const missingResolvedName = []
    for (const item of items) {
      if (item.instrumentation.resolvedName === undefined) {
        missingResolvedName.push(item)
      } else if (item.instrumentation.resolvedName === resolvedName) {
        // We already have this specific instance of the module tracked.
        // So we don't need to do anything.
        return
      }
    }

    // eslint-disable-next-line sonarjs/no-small-switch
    switch (missingResolvedName.length) {
      case 0: {
        // We have encountered a new instance of the module. Therefore, we
        // need to clone an existing instrumentation, but apply a different
        // `resolvedName` to it.
        //
        // This happens when there is a dependency tree like:
        // + `/opt/app/node_modules/foo`
        // + `/opt/app/node_modules/transitive-dep/node_modules/foo`
        const item = items[0]
        this.track(
          moduleName,
          new InstrumentationDescriptor({ ...item.instrumentation, resolvedName })
        )
        break
      }

      default: {
        // Add the same name to all found instrumentations. This definitely
        // happens when the security agent is enabled.
        missingResolvedName.forEach((item) => {
          item.instrumentation.resolvedName = resolvedName
        })
      }
    }
  }
After a module has been loaded, via `require` or `import`, the tracked
instrumentation for that module must have its `resolvedName` property
updated. The `resolvedName` is used to uniquely identify instances of the
module. Being able to uniquely identify instances is crucial to being able
to instrument all loaded instances.

@param {string} moduleName The simple name of the module, e.g. "pino".
@param {string} resolvedName The fully resolved file system path to the
module instance, e.g. "/opt/app/node_modules/pino".

@throws {Error} If the provided `moduleName` is not present in the tracker.