-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set default Propagators list and bash script flags (#1226)
We want the default propagators to include both w3c context and xray, so set `OTEL_PROPAGATORS=tracecontext,baggage,xray` if it isn't already set to something else. Users that send traces to X-Ray, especially if they enable Active Tracing, should override this value to `OTEL_PROPAGATORS=tracecontext,baggage,xray-lambda` to ensure proper span relationships. I also added some common bash flags to align with industry standard practice.
- Loading branch information
1 parent
87e2f04
commit 039caa5
Showing
9 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -ef -o pipefail | ||
|
||
export NODE_OPTIONS="${NODE_OPTIONS} --require /opt/wrapper.js" | ||
|
||
if [[ $OTEL_RESOURCE_ATTRIBUTES != *"service.name="* ]]; then | ||
export OTEL_RESOURCE_ATTRIBUTES="service.name=${AWS_LAMBDA_FUNCTION_NAME},${OTEL_RESOURCE_ATTRIBUTES}" | ||
fi | ||
|
||
if [[ -z "$OTEL_PROPAGATORS" ]]; then | ||
export OTEL_PROPAGATORS="tracecontext,baggage,xray" | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
set -euf -o pipefail | ||
|
||
cp -r ../src/otel . | ||
cp ../src/run.sh layer.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters