Skip to content

Commit

Permalink
Enable http instrumentations for lambda (#306)
Browse files Browse the repository at this point in the history
*Description of changes:*
Enabling popular Python httpclient libraries in order to fix the broken
xray propagation issue when calling downstream APIGW in Lambda layer.

Performance testing results:
https://quip-amazon.com/asqwA9QvcfjI/Performance-Testing-Enabled-Instrumentations-in-Lambda-Layer

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
  • Loading branch information
liustve authored Jan 7, 2025
2 parents 2e4f118 + 2bcab30 commit 768c90a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lambda-layer/src/otel-instrument
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ fi

export LAMBDA_RESOURCE_ATTRIBUTES="cloud.region=$AWS_REGION,cloud.provider=aws,faas.name=$AWS_LAMBDA_FUNCTION_NAME,faas.version=$AWS_LAMBDA_FUNCTION_VERSION,faas.instance=$AWS_LAMBDA_LOG_STREAM_NAME,aws.log.group.names=$AWS_LAMBDA_LOG_GROUP_NAME";

if [ -z ${OTEL_PROPAGATORS} ]; then
export OTEL_PROPAGATORS="xray,tracecontext,b3,b3multi"
fi

if [ -z "${OTEL_AWS_APPLICATION_SIGNALS_ENABLED}" ]; then
export OTEL_AWS_APPLICATION_SIGNALS_ENABLED="true";
Expand Down Expand Up @@ -126,7 +129,7 @@ fi
# - Enable botocore instrumentation by default

if [ -z ${OTEL_PYTHON_DISABLED_INSTRUMENTATIONS} ]; then
export OTEL_PYTHON_DISABLED_INSTRUMENTATIONS="aio-pika,aiohttp-client,aiohttp-server,aiopg,asgi,asyncio,asyncpg,boto,boto3,cassandra,celery,confluent_kafka,dbapi,django,elasticsearch,falcon,fastapi,flask,grpc_client,grpc_server,grpc_aio_client,grpc_aio_server,httpx,jinja2,kafka,logging,mysql,mysqlclient,pika,psycopg,psycopg2,pymemcache,pymongo,pymysql,pyramid,redis,remoulade,requests,sklearn,sqlalchemy,sqlite3,starlette,system_metrics,threading,tornado,tortoiseorm,urllib,urllib3,wsgi"
export OTEL_PYTHON_DISABLED_INSTRUMENTATIONS="aio-pika,aiohttp-client,aiohttp-server,aiopg,asgi,asyncio,asyncpg,boto,boto3,cassandra,celery,confluent_kafka,dbapi,django,elasticsearch,falcon,fastapi,flask,grpc_client,grpc_server,grpc_aio_client,grpc_aio_server,httpx,jinja2,kafka,logging,mysql,mysqlclient,pika,psycopg,psycopg2,pymemcache,pymongo,pymysql,pyramid,redis,remoulade,requests,sklearn,sqlalchemy,sqlite3,starlette,system_metrics,threading,tornado,tortoiseorm,wsgi"
fi
export OTEL_PYTHON_DISABLED_INSTRUMENTATIONS="$OTEL_PYTHON_DISABLED_INSTRUMENTATIONS,aws-lambda";

Expand Down

0 comments on commit 768c90a

Please sign in to comment.