-
Notifications
You must be signed in to change notification settings - Fork 5k
Add remaining System.Net.Http Telemetry #40838
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
Conversation
Tagging subscribers to this area: @dotnet/ncl |
Tagging subscribers to this area: @dotnet/ncl |
/azp run runtime-libraries outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
I got up until HttpConnection
. So far looks good, just some questions.
I will finish tomorrow unless somebody else takes over.
@@ -148,6 +157,8 @@ public Http2Connection(HttpConnectionPool pool, Connection connection) | |||
} | |||
} | |||
|
|||
~Http2Connection() => Dispose(); |
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.
Q: Do we really need this?
Http2Connection
is internal. Do we have complete control over its life-cycle or not? If yes, we should be Disposing
properly already.
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.
We have complete ownership of it at all times, but it's not guaranteed that Dispose will ever be called if the HttpClient/Handler is never disposed of as there is no finalizer higher up in the chain.
We could instead introduce a finalizer higher in the chain (for example on ConnectionPoolManager) to avoid having one per Http2Connection, but such a finalizer isn't needed for any other use-case / for HTTP/1 at the moment afaik.
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.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.
lgtm
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
_totalHttp20StreamsCounter ??= new PollingCounter("http20-streams-current-total", this, () => Interlocked.Read(ref _openedHttp20Streams)) | ||
{ | ||
DisplayName = "Current Http 2.0 Streams" | ||
}; |
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.
An HTTP/2 stream is the same as a request. Do we need this counter? And if so, what's the 1.1 equivalent?
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.
I see this counter isn't actually listed in David's tracking issue (#37428), removed.
I added it coming from discussions around the usefulness of "single-pool-max" counters in #38686.
I realize such counters ("http11-current", "http20-current") can be implemented in a much simpler manner than was done in this PR, as we already have guarantees around Start/Stop being called on an HttpRequestMessage
exactly once and we have the version info available there.
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.
I see this counter isn't actually listed in David's tracking issue
Are there others you added that weren't previously discussed and should be removed, too?
/azp run runtime-libraries outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
Regex and X509Cert test failures unrelated. |
Adds the following events:
Http11ConnectionEstablished
Http11ConnectionClosed
Http20ConnectionEstablished
Http20ConnectionClosed
Http11RequestLeftQueue
ResponseHeadersBegin
Adds the following counters:
http11-connections-current-total
http20-connections-current-total
http11-requests-queue-duration
Contributes to #37428