Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-lambda: Cannot use AdotInstrumentation for dotnet lambdas #31182

Open
1 task
Dreamescaper opened this issue Aug 22, 2024 · 3 comments
Open
1 task

aws-lambda: Cannot use AdotInstrumentation for dotnet lambdas #31182

Dreamescaper opened this issue Aug 22, 2024 · 3 comments
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@Dreamescaper
Copy link

Dreamescaper commented Aug 22, 2024

Describe the bug

Accodring to the Getting Started page, you don't need to set ExecWrapper for dotnet lambdas.
However, ExecWrapper is required with CDK.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

AdotInstrumentation should allow to omit ExecWrapper property.

Current Behavior

ExecWrapper property is mandatory.

Reproduction Steps

new Function(this, "func-id", new FunctionProps
{
    Handler = "My::Handler::Method",
    Code = Code.FromAsset("publish/MyCode.zip"),
    Runtime = Runtime.DOTNET_8,
    AdotInstrumentation = new AdotInstrumentationConfig
    {
        LayerVersion = AdotLayerVersion.FromGenericLayerVersion(AdotLambdaLayerGenericVersion.LATEST)
    }
});

// SII001	The property ExecWrapper is required and cannot be null.

Language

.NET

@Dreamescaper Dreamescaper added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 22, 2024
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Aug 22, 2024
@ashishdhingra
Copy link
Contributor

ashishdhingra commented Aug 22, 2024

Findings:

  • execWrapper is marked as required (not optional) per AdotInstrumentationConfig definition.
  • execWrapper accepts one of the values defined as part of AdotLambdaExecWrapper enum.
  • If you check the commit history, execWrapper is the required field since last 2 years.
  • The link AWS Distro for OpenTelemetry Lambda Support For .NET demonstrates adding manual instrumentation using .NET as an example.
  • If you refer other links (except .NET and Go), e.g. AWS Distro for OpenTelemetry Lambda Support For JavaScript, it talks about setting AWS_LAMBDA_EXEC_WRAPPER environment variable.
  • The value set for execWrapper sets the environment variable AWS_LAMBDA_EXEC_WRAPPER here.
  • Per AWS Lambda > Wrapper scripts, environment variable AWS_LAMBDA_EXEC_WRAPPER could be used to set file system path of an executable binary or script, which allows to customize the runtime startup behavior of your Lambda function. A wrapper script enables you to set configuration parameters that cannot be set through language-specific environment variables.
  • Unsure if automatic tracing could be enabled for .NET and if execWrapper should be required for .NET.

@Dreamescaper Could you please share what happens if you set execWrapper to AdotLambdaExecWrapper.REGULAR_HANDLER.

@ashishdhingra ashishdhingra added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Aug 22, 2024
@ashishdhingra
Copy link
Contributor

Internal tracking ticket: P150043839

@ashishdhingra
Copy link
Contributor

Update on internal tracking ticket: execWrapper is not mandatory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

No branches or pull requests

2 participants