Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nodejs/layer-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 16 additions & 2 deletions nodejs/packages/layer/src/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ function defaultConfigureInstrumentations() {
RedisInstrumentation,
} = require("@opentelemetry/instrumentation-redis");
return [
new AwsInstrumentation(),
new DnsInstrumentation(),
new ExpressInstrumentation(),
new GraphQLInstrumentation(),
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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,
Expand Down
Loading