-
Notifications
You must be signed in to change notification settings - Fork 5.2k
disable/trim MetricsHandler when System.Diagnostics.Metrics.Meter.IsSupported is false #114326
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
disable/trim MetricsHandler when System.Diagnostics.Metrics.Meter.IsSupported is false #114326
Conversation
|
Tagging subscribers to this area: @dotnet/ncl |
|
cc @antonfirsov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 11 out of 15 changed files in this pull request and generated 2 comments.
Files not reviewed (4)
- src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.xml: Language not supported
- src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj: Language not supported
- src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.EventSource.xml: Language not supported
- src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj: Language not supported
src/libraries/System.Net.Http/src/System/Net/Http/DiagnosticsHandler.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/DiagnosticsHandler.cs
Outdated
Show resolved
Hide resolved
…andler.cs Co-authored-by: Copilot <[email protected]>
…andler.cs Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
src/libraries/System.Net.Http/src/System/Net/Http/DiagnosticsHandler.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the PR ensure that the SocketsHttpHandlerMetrics and the ConnectionMetrics types are also trimmed away when metrics are disabled?
src/libraries/System.Net.Http/src/System/Net/Http/DiagnosticsHandler.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/DiagnosticsHandler.cs
Outdated
Show resolved
Hide resolved
...ystem.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectionPool/HttpConnectionWaiter.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionBase.cs
Outdated
Show resolved
Hide resolved
|
Fixed. It works when there are no indirections between the trimmed property and methods that use them |
# Conflicts: # src/libraries/System.Net.Http/src/System/Net/Http/GlobalHttpSettings.cs
src/libraries/System.Net.Http/src/System/Net/Http/GlobalHttpSettings.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/tests/TrimmingTests/MetricsHandlerTrimmedTest.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo small suggestion. Thanks!
Edit: Just noticed MetricsHandlerTrimmedTest.cs is failing, will check this again after the fix.
...ystem.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectionPool/HttpConnectionWaiter.cs
Outdated
Show resolved
Hide resolved
…andler/ConnectionPool/HttpConnectionWaiter.cs Co-authored-by: Anton Firszov <[email protected]>
System.Diagnostics.Metrics.Meter.IsSupportedto disable/trimMetricsHandlerSystem.Net.Http.EnableActivityPropagationto disable/trimDiagnosticsHandler