-
Notifications
You must be signed in to change notification settings - Fork 37
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
.NET 8 AOT Lambda w/ X-Ray #46
Comments
Thanks for opening this issue. Could you please provide the output of the |
After updating some references -- and rooting another assembly (System.Linq.Expressions) -- I got past the error described above and now see...
Based on the stack trace, it appears to be a couple of steps further along. The trim warnings I see are...
And the assemblies I've rooted are... <ItemGroup>
<TrimmerRootAssembly Include="Amazon.Lambda.RuntimeSupport" />
<TrimmerRootAssembly Include="AWSSDK.Core" />
<TrimmerRootAssembly Include="AWSXRayRecorder.Core" />
<TrimmerRootAssembly Include="AWSXRayRecorder.Handlers.AwsSdk" />
<TrimmerRootAssembly Include="System.Linq.Expressions" />
</ItemGroup> I don't see any other things to root based on the trim warnings. Any other ideas? |
Your code is now throwing at this line of code it looks like: https://github.com/aws/aws-xray-sdk-dotnet/blob/0867b0601a62cebfd744ba857f03284fd5d2cc81/sdk/src/Handlers/AwsSdk/Internal/XRayPipelineHandler.cs#L293 Which calls this: https://github.com/aws/aws-xray-sdk-dotnet/blob/0867b0601a62cebfd744ba857f03284fd5d2cc81/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs#L862 It seems like a similar issue was opened here: aws/aws-xray-sdk-dotnet#295 The xray libraries haven't been made trim-safe as you can see by the requirement to use It seems like the code is trying to convert this file (or a similar file) into a dictionary of known AWS Service types, which is why this error only seems to come up once you try to trace calls to another service. (Basic xray for an isolated Lambda seem to work fine for me.) I would have thought those types were in |
Thanks for the help, @Beau-Gosse-dev. I'll follow up with the X-Ray people. |
@tmschlot did you find any workarounds? |
When we add X-Ray to a working AOT-compiled Lambda function, we get the following exception:
This .NET 7 sample has X-Ray included, but this commit removes it from the .NET 8 sample. There is no explanation for why it was removed, though. Was it this same issue? I'm just trying to figure out if I'm doing something wrong or if a gap remains with the X-Ray support.
I have attempted to "root" various assemblies and modify trim settings to make this work. The only way I have found to get around the problem is to not publish with AOT and to a self-contained executable. Any other info would be helpful.
Thanks.
The text was updated successfully, but these errors were encountered: