diff --git a/nodejs/layer-data.sh b/nodejs/layer-data.sh index 47a451d..e450f93 100755 --- a/nodejs/layer-data.sh +++ b/nodejs/layer-data.sh @@ -3,7 +3,7 @@ OFFICIAL_LAYER_NAME=sumologic-otel-lambda-nodejs ARCHITECTURE_AMD=x86_64 ARCHITECTURE_ARM=arm64 -RUNTIMES='nodejs18.x nodejs20.x nodejs22.x' +RUNTIMES=(nodejs18.x nodejs20.x nodejs22.x) DESCRIPTION='Sumo Logic OTel Collector and NodeJS Lambda Layer https://github.com/SumoLogic/sumologic-otel-lambda/tree/main/nodejs' LICENSE=Apache-2.0 VERSION=v2-0-0 diff --git a/nodejs/packages/layer/src/wrapper.ts b/nodejs/packages/layer/src/wrapper.ts index b7a7d97..2d6b2b0 100644 --- a/nodejs/packages/layer/src/wrapper.ts +++ b/nodejs/packages/layer/src/wrapper.ts @@ -85,7 +85,6 @@ function defaultConfigureInstrumentations() { RedisInstrumentation, } = require("@opentelemetry/instrumentation-redis"); return [ - new AwsInstrumentation(), new DnsInstrumentation(), new ExpressInstrumentation(), new GraphQLInstrumentation(), @@ -157,6 +156,17 @@ function getExportersFromEnv() { const logLevel = diagLogLevelFromString(getStringFromEnv('OTEL_LOG_LEVEL')); diag.setLogger(new DiagConsoleLogger(), logLevel); +// Configure suppressInternalInstrumentation for AwsInstrumentation +let suppressInternalInstrumentation = true; +const sumoOtelSuppressAwsInstrumentationVal = + process.env.SUMO_OTEL_SUPPRESS_AWS_INSTRUMENTATION; +if ( + sumoOtelSuppressAwsInstrumentationVal === "false" || + sumoOtelSuppressAwsInstrumentationVal === "False" +) { + suppressInternalInstrumentation = false; +} + // Map vendor-specific endpoint to OTel variable before exporter creation // Keep using localhost collector but ensure proper endpoint mapping if (process.env.SUMO_OTLP_HTTP_ENDPOINT_URL && !process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT) { @@ -197,11 +207,15 @@ if (logLevel === DiagLogLevel.DEBUG) { "SUMO_OTEL_DISABLE_AWS_CONTEXT_PROPAGATION value", process.env.SUMO_OTEL_DISABLE_AWS_CONTEXT_PROPAGATION ); + console.log( + "SUMO_OTEL_SUPPRESS_AWS_INSTRUMENTATION value", + process.env.SUMO_OTEL_SUPPRESS_AWS_INSTRUMENTATION + ); } const instrumentations = [ new AwsInstrumentation({ - suppressInternalInstrumentation: true, + suppressInternalInstrumentation: suppressInternalInstrumentation, }), new AwsLambdaInstrumentation({ disableAwsContextPropagation: disableAwsContextPropagation,