-
Notifications
You must be signed in to change notification settings - Fork 251
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
AWSTracingPipelineHandler produces IL2075 warning when compiling for native AoT #1543
Comments
@normj Any suggestions on how to resolve this IL2075 warning? The only things I can think of are:
I tried adding the constraint on |
@martincostello We know the properties will be used in the request marshallers in the SDK to create the HTTP request. So the AOT compiler can't trim the properties out and we can assume they exist. I would use the
|
Thanks Norm - I'll try that out later today. |
Resolve AoT warning. Fixes open-telemetry#1543.
Resolve AoT warning. Fixes open-telemetry#1543.
Resolve AoT warning. Fixes open-telemetry#1543.
Issue with OpenTelemetry.Instrumentation.AWS
List of all OpenTelemetry NuGet packages and version that you are using (e.g.
OpenTelemetry 1.3.2
):OpenTelemetry.Instrumentation.AWS 1.1.0-beta.2
Runtime version:
net6.0
+Is this a feature request or a bug?
What is the expected behavior?
When OpenTelemetry.Instrumentation.AWS is referenced in an application compiled with native AoT, there are no trim warnings.
What is the actual behavior?
1 trim warning is produced by the assembly's own code (an additional 2 are from the AWS SDK, see #1542).
C:\Coding\open-telemetry\opentelemetry-dotnet-contrib\src\OpenTelemetry.Instrumentation.AWS\Implementation\AWSTracingPipelineHandler.cs(141): Trim analysis error IL2075: OpenTelemetry.Instrumentation.AWS.Implementation.AWSTracingPipelineHandler.AddRequestSpecificInformation(Activity,IRequestContext,String): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. The return value of method 'System.Object.GetType()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. [C:\Coding\open-telemetry\opentelemetry-dotnet-contrib\test\OpenTelemetry.AotCompatibility.TestApp\OpenTelemetry.AotCompatibility.TestApp.csproj]
This warning comes from this line:
opentelemetry-dotnet-contrib/src/OpenTelemetry.Instrumentation.AWS/Implementation/AWSTracingPipelineHandler.cs
Line 137 in 8a89a69
Additional Context
Found while going through the AWS-related libraries while looking for the source of trim warnings.
I did have a look at trying to fix this one myself, but it was beyond my expertise in this case.
The text was updated successfully, but these errors were encountered: