Skip to content

Commit

Permalink
Remove otel-instrument-est wraper (#103)
Browse files Browse the repository at this point in the history
*Issue #, if available:*

*Description of changes:*
Follow changes on
#101.

Instead of using a `otel-instrument-esm` wrapper which is redudent, we
will have customer to use `HANDLER_IS_ESM` env var to enforce ESM
instrumentation for the failed to detected cases.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
  • Loading branch information
mxiamxia authored Oct 11, 2024
1 parent 2df6d5d commit c09824f
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 c09824f

Please sign in to comment.