function getInstrumentationsFromEnv()

in packages/opentelemetry-node/lib/instrumentations.js [181:202]


function getInstrumentationsFromEnv(envvar) {
    const names = getStringListFromEnv(envvar);
    if (names) {
        const instrumentations = [];

        for (const name of names) {
            if (otelInstrShortNames.has(name)) {
                instrumentations.push(`${otelInstrPrefix}${name}`);
            } else if (nonOtelInstrNames.has(name)) {
                instrumentations.push(name);
            } else {
                log.warn(
                    `Unknown instrumentation "${name}" specified in the environment variable ${envvar}`
                );
            }
        }

        return instrumentations;
    }

    return undefined;
}