Skip to content

Commit 7e65e8a

Browse files
committed
renaming to otel-instrument. Setting some default configs
1 parent 015c6db commit 7e65e8a

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

lambda-layer/build-layer.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ popd
4545

4646
## Copy ADOT Java Agent downloaded using Gradle task and bundle it with the Lambda handler script
4747
cp "$SOURCEDIR"/build/javaagent/aws-opentelemetry-agent*.jar ./opentelemetry-javaagent.jar
48-
zip -qr opentelemetry-javaagent-layer.zip opentelemetry-javaagent.jar otel-handler
48+
zip -qr opentelemetry-javaagent-layer.zip opentelemetry-javaagent.jar otel-instrument

lambda-layer/otel-handler renamed to lambda-layer/otel-instrument

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ export OTEL_INSTRUMENTATION_AWS_SDK_EXPERIMENTAL_SPAN_ATTRIBUTES=true
44

55
export OTEL_PROPAGATORS="${OTEL_PROPAGATORS:-xray,tracecontext,b3,b3multi}"
66

7-
# Temporarily set OTEL_SERVICE_NAME variable to work around but in javaagent not handling
8-
# OTEL_RESOURCE_ATTRIBUTES as set in otel-handler-upstream. It doesn't hurt to apply this
9-
# to wrapper as well.
10-
# TODO(anuraaga): Move to opentelemetry-lambda
117
export OTEL_SERVICE_NAME=${OTEL_SERVICE_NAME:-${AWS_LAMBDA_FUNCTION_NAME}}
128

139
export JAVA_TOOL_OPTIONS="-javaagent:/opt/opentelemetry-javaagent.jar ${JAVA_TOOL_OPTIONS}"
@@ -21,4 +17,16 @@ export OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT=10000
2117
# Disable the Application Signals runtime metrics since we are on Lambda
2218
export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false
2319

20+
# Use OTLP traces exporter if not specified
21+
export OTEL_TRACES_EXPORTER=${OTEL_TRACES_EXPORTER:-"otlp"}
22+
23+
# Enable Application Signals by default if not specified
24+
export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=${OTEL_AWS_APPLICATION_SIGNALS_ENABLED:-"true"}
25+
26+
# If Application Signals is enabled
27+
if [ "${OTEL_AWS_APPLICATION_SIGNALS_ENABLED}" = "true" ]; then
28+
export OTEL_METRICS_EXPORTER=${OTEL_METRICS_EXPORTER:-"none"}
29+
export OTEL_LOGS_EXPORTER=${OTEL_LOGS_EXPORTER:-"none"}
30+
fi
31+
2432
exec "$@"

0 commit comments

Comments
 (0)