Describe the bug
The ADOT Lambda auto-instrumentation does not work for python function, as the exec wrapper does not match the expected values for python adot
Expected Behavior
As per the ADOT documentation on auto-instumenting a python lambda function, the AWS_LAMBDA_EXEC_WRAPPER envar should be set to the value /opt/otel-instrument.
Current Behavior
The envar is set to one of 3 values, per the enum:
REGULAR_HANDLER = '/opt/otel-handler',
PROXY_HANDLER = '/opt/otel-proxy-handler',
STREAM_HANDLER = '/opt/otel-stream-handler',
Reproduction Steps
new lambda.Function(this, "MyFunction", {
runtime: lambda.Runtime.PYTHON_3_9,
handler: "index.handler",
code: lambda.Code.fromAsset(path.join(__dirname, "lambda-handler")),
adotInstrumentation: {
layerVersion: lambda.AdotLayerVersion.fromPythonSdkLayerVersion(
lambda.AdotLambdaLayerPythonSdkVersion.LATEST
),
execWrapper: lambda.AdotLambdaExecWrapper.REGULAR_HANDLER,
},
});
Possible Solution
- Provide an enum value that works for python (or a way to provide a custom value to match the type)
- Detect python functions and just set the value to be
/opt/otel-instrument
- Work with ADOT to make the python value match other languages
Additional Information/Context
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.AdotInstrumentationConfig.html
CDK CLI Version
2.69
Framework Version
No response
Node.js Version
n/a
OS
n/a
Language
Typescript
Language Version
No response
Other information
No response
Describe the bug
The ADOT Lambda auto-instrumentation does not work for python function, as the exec wrapper does not match the expected values for python adot
Expected Behavior
As per the ADOT documentation on auto-instumenting a python lambda function, the
AWS_LAMBDA_EXEC_WRAPPERenvar should be set to the value/opt/otel-instrument.Current Behavior
The envar is set to one of 3 values, per the enum:
Reproduction Steps
Possible Solution
/opt/otel-instrumentAdditional Information/Context
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.AdotInstrumentationConfig.html
CDK CLI Version
2.69
Framework Version
No response
Node.js Version
n/a
OS
n/a
Language
Typescript
Language Version
No response
Other information
No response