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.71k stars 3.93k forks source link

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

Open Dreamescaper opened 3 months ago

Dreamescaper commented 3 months ago

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

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

ashishdhingra commented 3 months ago

Findings:

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

ashishdhingra commented 3 months ago

Internal tracking ticket: P150043839

ashishdhingra commented 1 month ago

Update on internal tracking ticket: execWrapper is not mandatory.