aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.39k stars 3.79k forks source link

aws-lambda: AdotLambdaExecWrapper is missing an element for /opt/otel-sqs-handler #30310

Open vchik795 opened 1 month ago

vchik795 commented 1 month ago

Describe the feature

According to the OpenTelemetry documentation, the environment variable AWS_LAMBDA_EXEC_WRAPPER is supposed to be set to /opt/otel-sqs-handler for SQS-triggered Lambda handlers. However, there is no corresponding element for it in the AdotLambdaExecWrapper enum.

Use Case

When enabling ADOT instrumentation for an SQS-triggered Lambda function, there is no way to set the environment variable AWS_LAMBDA_EXEC_WRAPPER to /opt/otel-sqs-handler. And using the available /opt/otel-handler (REGULAR_HANDLER) leads to issues like this one.

Proposed Solution

Add a new element to the AdotLambdaExecWrapper enum that would support /opt/otel-sqs-handler.

Other Information

No response

Acknowledgements

CDK version used

2.139

Environment details (OS name and version, etc.)

N/A

khushail commented 1 month ago

Yes, @vchik795 , this enum - https://github.com/aws/aws-cdk/blob/dfea72118790ea591d9de720f337c1e14eb11411/packages/aws-cdk-lib/aws-lambda/lib/adot-layers.ts#L170 needs to have the mentioned element.

PR from the community is welcome !

vchik795 commented 1 month ago

Thank you for creating the pull request, @mazyu36. Do you think it is going to be merged any time soon?

mazyu36 commented 1 month ago

@vchik795 Thank you for your comment. The PR is currently awaiting review from the community. While the review process will eventually progress and it will be merged, I'm not sure exactly when the review will take place. I kindly ask that you wait for a little while.​​​​​​​​​​​​​​​​