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.67k stars 3.92k forks source link

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

Open Dreamescaper opened 2 months ago

Dreamescaper commented 2 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 2 months ago

Findings:

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

ashishdhingra commented 2 months ago

Internal tracking ticket: P150043839

ashishdhingra commented 3 weeks ago

Update on internal tracking ticket: execWrapper is not mandatory.