From fb807835e9317891e6f18715e708e9993b8797d8 Mon Sep 17 00:00:00 2001 From: Ben Eggers <64657842+beggers@users.noreply.github.com> Date: Fri, 1 Dec 2023 12:20:23 -0800 Subject: [PATCH] fix(instrumentation-lambda): soften "unable to init" message and demote to diag.debug (#1836) Co-authored-by: Trent Mick --- .../src/instrumentation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts index ca3d173d82..0b85377d1d 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts @@ -101,8 +101,8 @@ export class AwsLambdaInstrumentation extends InstrumentationBase { // _HANDLER and LAMBDA_TASK_ROOT are always defined in Lambda but guard bail out if in the future this changes. if (!taskRoot || !handlerDef) { - diag.error( - 'Unable to initialize instrumentation for lambda. Cannot identify lambda handler or task root.', + this._diag.debug( + 'Skipping lambda instrumentation: no _HANDLER/lambdaHandler or LAMBDA_TASK_ROOT.', { taskRoot, handlerDef } ); return [];