Skip to content

Commit c09824f

Browse files
authored
Remove otel-instrument-est wraper (#103)
*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.
1 parent 2df6d5d commit c09824f

File tree

2 files changed

+2
-48
lines changed

2 files changed

+2
-48
lines changed

lambda-layer/packages/layer/scripts/otel-instrument

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
isESMScript() {
2+
_is_esm_handler() {
33
# Lambda function root directory
44
TASK_DIR="/var/task"
55

@@ -28,7 +28,7 @@ isESMScript() {
2828
fi
2929
}
3030

31-
if isESMScript; then
31+
if _is_esm_handler || [[ ${HANDLER_IS_ESM} == true ]]; then
3232
export NODE_OPTIONS="${NODE_OPTIONS} --import @aws/aws-distro-opentelemetry-node-autoinstrumentation/register --experimental-loader=@opentelemetry/instrumentation/hook.mjs"
3333
export HANDLER_IS_ESM=true
3434
else

lambda-layer/packages/layer/scripts/otel-instrument-esm

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)