function recordLoaderMetric(agent) {
  let isDashR = false

  process.execArgv.forEach((arg, index) => {
    if (arg === '-r' && process.execArgv[index + 1] === 'newrelic') {
      agent.metrics.getOrCreateMetric(NAMES.FEATURES.CJS.PRELOAD).incrementCallCount()
      isDashR = true
    } else if (
      (arg === '--loader' || arg === '--experimental-loader') &&
      process.execArgv[index + 1] === 'newrelic/esm-loader.mjs'
    ) {
      agent.metrics.getOrCreateMetric(NAMES.FEATURES.ESM.LOADER).incrementCallCount()
    }
  })

  if (!isDashR) {
    agent.metrics.getOrCreateMetric(NAMES.FEATURES.CJS.REQUIRE).incrementCallCount()
  }
}
Used to determine how the agent is getting loaded:
 1. -r newrelic
 2. --loader newrelic/esm-loader.mjs
 3. require('newrelic')

 Then a supportability metric is loaded to decide.

@param {Agent} agent active NR agent