Skip to content
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

[AOT] suppressed trimming warnings in AspNetCore and GrpcNetClient Instrumentation packages #4795

Merged
merged 8 commits into from Aug 22, 2023

Conversation

Yun-Ting
Copy link
Contributor

@Yun-Ting Yun-Ting commented Aug 21, 2023

Towards #3429

cc: @vitek-karas @eerhardt

Changes

Suppressed trimming warnings IL2026 in AspNetCore and GrpcNetClient Instrumentation packages because the AOT-annotation DynamicallyAccessedMembers
https://learn.microsoft.com/dotnet/api/system.diagnostics.codeanalysis.dynamicallyaccessedmembersattribute?view=net-7.0
ensures that top-level properties on the payload object are always preserved.

For OpenTelemetry.Instrumentation.AspNetCore, see https://github.com/dotnet/aspnetcore/blob/690d78279e940d267669f825aa6627b0d731f64c/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs#L252
, and https://github.com/dotnet/aspnetcore/blob/690d78279e940d267669f825aa6627b0d731f64c/src/Middleware/Diagnostics/src/DeveloperExceptionPage/DeveloperExceptionPageMiddlewareImpl.cs#L174

For OpenTelemetry.GrpcNetClient.Instrumentation, see
https://github.com/grpc/grpc-dotnet/blob/ff1a07b90c498f259e6d9f4a50cdad7c89ecd3c0/src/Grpc.Net.Client/Internal/GrpcCall.cs#L1180-L1183

Merge requirement checklist

  • CONTRIBUTING guidelines followed (nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@Yun-Ting Yun-Ting marked this pull request as ready for review August 21, 2023 22:06
@Yun-Ting Yun-Ting requested a review from a team as a code owner August 21, 2023 22:06
@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Merging #4795 (954a7b7) into main (73df32b) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4795      +/-   ##
==========================================
+ Coverage   85.57%   85.62%   +0.04%     
==========================================
  Files         284      284              
  Lines       11683    11686       +3     
==========================================
+ Hits         9998    10006       +8     
+ Misses       1685     1680       -5     
Files Changed Coverage Δ
...tation.AspNetCore/Implementation/HttpInListener.cs 91.66% <100.00%> (+0.04%) ⬆️
...ent/Implementation/GrpcClientDiagnosticListener.cs 88.57% <100.00%> (+0.33%) ⬆️

... and 3 files with indirect coverage changes

Copy link
Contributor

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vitek-karas
Copy link
Contributor

because the AOT-annotation DynamicallyAccessedMembers
https://learn.microsoft.com/dotnet/api/system.diagnostics.codeanalysis.dynamicallyaccessedmembersattribute?view=net-7.0
in Systm.Net.Http library ensures that top-level properties on the payload object are always preserved.

This is part of the PR description - and it's incorrect - it's probably a copy/paste from the previous PR which did this for System.Net.Http.

Copy link
Contributor

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me with a non-blocking naming question.

@utpilla utpilla merged commit 0d1cc36 into open-telemetry:main Aug 22, 2023
28 checks passed
@Yun-Ting Yun-Ting deleted the yunl/aotGrpcClient branch August 22, 2023 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants