AWSTracingPipelineHandler produces IL2075 warning when compiling for native AoT #1543
Closed
1 of 2 tasks
Labels
comp:instrumentation.aws
Things related to OpenTelemetry.Instrumentation.AWS
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: