Skip to content

Commit

Permalink
Remove otel-instrument-est wraper and have ESM check in one wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
mxiamxia committed Oct 11, 2024
1 parent 2df6d5d commit 77add5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 48 deletions.
4 changes: 2 additions & 2 deletions lambda-layer/packages/layer/scripts/otel-instrument
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
isESMScript() {
_is_esm_handler() {
# Lambda function root directory
TASK_DIR="/var/task"

Expand Down Expand Up @@ -28,7 +28,7 @@ isESMScript() {
fi
}

if isESMScript; then
if _is_esm_handler || [[ ${HANDLER_IS_ESM} == true ]]; then
export NODE_OPTIONS="${NODE_OPTIONS} --import @aws/aws-distro-opentelemetry-node-autoinstrumentation/register --experimental-loader=@opentelemetry/instrumentation/hook.mjs"
export HANDLER_IS_ESM=true
else
Expand Down
46 changes: 0 additions & 46 deletions lambda-layer/packages/layer/scripts/otel-instrument-esm

This file was deleted.

0 comments on commit 77add5a

Please sign in to comment.