From d0cb0f9815a0cd9e2cada5d5f856aabf56de1c72 Mon Sep 17 00:00:00 2001 From: tammy-baylis-swi Date: Fri, 4 Oct 2024 15:18:21 -0700 Subject: [PATCH] Simplify lambda wrapper defaults --- lambda/solarwinds-apm/wrapper | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lambda/solarwinds-apm/wrapper b/lambda/solarwinds-apm/wrapper index 1a98e60b..b2d0222a 100755 --- a/lambda/solarwinds-apm/wrapper +++ b/lambda/solarwinds-apm/wrapper @@ -27,11 +27,10 @@ export LAMBDA_LAYER_PKGS_DIR="/opt/python"; export PYTHONPATH="$LAMBDA_LAYER_PKGS_DIR:$PYTHONPATH"; export PYTHONPATH="$LAMBDA_RUNTIME_DIR:$PYTHONPATH"; -# Need to opt into OTLP traces exporter, always for lambda -export OTEL_TRACES_EXPORTER=otlp_proto_http - -# Need to opt into OTLP metrics export, always for lambda -export SW_APM_EXPORT_METRICS_ENABLED=true +# Default opt into OTLP metrics export in lambda +if [ -z "${SW_APM_EXPORT_METRICS_ENABLED}" ]; then + export SW_APM_EXPORT_METRICS_ENABLED=true +fi # Default OTEL_EXPORTER_OTLP_PROTOCOL for APM Python in lambda # for all of logs/trace/metrics is HTTP through otelcollector