diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts index a050359aec..38904f1563 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.debug( - 'Unable to initialize instrumentation for lambda. Cannot identify lambda handler.' + diag.error( + 'Unable to initialize instrumentation for lambda. Cannot identify lambda handler or task root.', {taskRoot, handlerDef} ); return []; } @@ -126,8 +126,7 @@ export class AwsLambdaInstrumentation extends InstrumentationBase { } } - diag.debug( - `Instrumenting lambda handler: ${JSON.stringify({ + diag.debug("Instrumenting lambda handler", { taskRoot, handlerDef, handler, @@ -135,8 +134,7 @@ export class AwsLambdaInstrumentation extends InstrumentationBase { module, filename, functionName, - })}` - ); + }); return [ new InstrumentationNodeModuleDefinition(