-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Moved HTTP request telemetry to HttpClient.SendAsync #41022
Moved HTTP request telemetry to HttpClient.SendAsync #41022
Conversation
Tagging subscribers to this area: @dotnet/ncl |
src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs
Outdated
Show resolved
Hide resolved
{ | ||
throw CreateTimeoutException(operationException); | ||
HttpTelemetry.Log.RequestStart( |
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.
So now you only get the telemetry if you use HtrpClient, but not if you use HttpMessageInvoker?
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.
Yes. Though in the previous state of things, you got the telemetry only with SocketsHandler
and not with any custom handler...
However, we can introduce child events to cover HttpMessageInvoker
etc. This event pair should be the main, all encompassing one. And in case a user wants to use the invoker directly, we should provide them with examples how to plug in their own telemetry to achieve the same.
I've some thoughts about this and I'm trying to put it all in writing in #40776 (not yet finished though).
150322e
to
508b24e
Compare
508b24e
to
ec189d4
Compare
/azp run runtime-libraries outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-libraries outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-libraries outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
This also fixes: #40896 |
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.
Two things in HttpMessageInvoker
otherwise LGTM. However, I cannot approve since it's my PR originally. @dotnet/ncl could anyone approve once all is addressed?
And thank you for taking this over and finishing ❤️
src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/HttpMessageInvoker.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.
Please, resolve all the Marie's comments.
Otherwise, LGTM
I pushed more changes here:
@ManickaP @alnikola Please re-review (should be simple to review on a commit-by-commit basis) |
/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.
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.
Single comment, otherwise LGTM.
/azp run runtime-libraries outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
Runtime CI failure: #41511 |
Outerloop CI Failures: All of them are timout related and do not seem to be related to the changes made in this PR. |
/azp run runtime-libraries outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
* Moved HTTP request telemetry to HttpClient.SendAsync * Added ResponseContent and helper methods events. * Rework helper method activity nesting * Expand Telemetry tests * Also log RequestStart/Stop in HttpMessageInvoker * Update RequestStart signature * RequestAborted => RequestFailed rename * ResponseContent Begin => Start/Stop * Fix HttpMessageInvoker implementation * Add Synchronous request Telemetry tests * Check telemetryStarted before ResponseContentStart Co-authored-by: MihaZupan <mihazupan.zupan1@gmail.com>
* System.Net Telemetry style changes (#41527) * Change HandshakeStop SslProtocols parameter to enum * Parameterize Http11/Http20 events * Add dummy request to ensure Http2 settings are received * Moved HTTP request telemetry to HttpClient.SendAsync (#41022) * Moved HTTP request telemetry to HttpClient.SendAsync * Added ResponseContent and helper methods events. * Rework helper method activity nesting * Expand Telemetry tests * Also log RequestStart/Stop in HttpMessageInvoker * Update RequestStart signature * RequestAborted => RequestFailed rename * ResponseContent Begin => Start/Stop * Fix HttpMessageInvoker implementation * Add Synchronous request Telemetry tests * Check telemetryStarted before ResponseContentStart Co-authored-by: MihaZupan <mihazupan.zupan1@gmail.com> * Add Request/Response Headers/Content Start/Stop events (#41590) Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
Moved HTTP request telemetry to HttpClient.SendAsync
Added events for ResponseContent
Added helper methods events
Contributes to #40776