Skip to content

Commit

Permalink
Make sure env var Python Resource Attr pairs are valid (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanielRN authored Nov 1, 2021
1 parent 76ec126 commit 5dd1b69
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion adot/python/src/otel/otel_sdk/otel-instrument
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ fi
# )
# )

export OTEL_RESOURCE_ATTRIBUTES="cloud.region=$AWS_REGION,cloud.provider=aws,faas.name=$AWS_LAMBDA_FUNCTION_NAME,faas.version=$AWS_LAMBDA_FUNCTION_VERSION,$OTEL_RESOURCE_ATTRIBUTES";
export LAMBDA_RESOURCE_ATTRIBUTES="cloud.region=$AWS_REGION,cloud.provider=aws,faas.name=$AWS_LAMBDA_FUNCTION_NAME,faas.version=$AWS_LAMBDA_FUNCTION_VERSION";

if [ -z ${OTEL_RESOURCE_ATTRIBUTES} ]; then
export OTEL_RESOURCE_ATTRIBUTES=$LAMBDA_RESOURCE_ATTRIBUTES;
else
export OTEL_RESOURCE_ATTRIBUTES="$LAMBDA_RESOURCE_ATTRIBUTES,$OTEL_RESOURCE_ATTRIBUTES";
fi

# - Set `OTEL_PROPAGATORS` if not yet set, and include the xray propagator

Expand Down

0 comments on commit 5dd1b69

Please sign in to comment.