function setFromEnv({ config, key, envVar, formatter, paths }) {
  const setting = process.env[envVar]
  if (setting) {
    const formattedSetting = formatter ? formatter(setting, logger) : setting
    // `setting` _should_ be a string when reading from the actual process
    // environment. But we have tests that construct an environment with
    // non-string values. So we need to convert them before accessing.
    const prefix = setting.toString().at(0)
    const suffix = setting.toString().at(-1)
    const redacted = prefix + '*'.repeat(setting.length) + suffix
    logger.trace({ env: { [envVar]: redacted } }, 'setting value from environment variable')
    setNestedKey(config, [...paths, key], formattedSetting)
  }
}
Assigns the value of an env var to its corresponding configuration path

@param {object} params object passed to fn
@param {object} params.config agent config
@param {string} params.key key to assign value
@param {string} params.envVar name of env var
@param {Function} params.formatter function to coerce env var as they are all strings
@param {Array} params.paths list of leaf nodes leading to the configuration value