-
Notifications
You must be signed in to change notification settings - Fork 5k
Add status code and exception info to System.Net.Http events #84036
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 Issue DetailsContributes to #83734 This PR adds the following parameters to existing events: -void RequestStop()
+void RequestStop(int statusCode)
-void ResponseHeadersStop()
+void ResponseHeadersStop(int statusCode)
-void RequestFailed();
+void RequestFailed(string exception); Copying the reasoning behind having the status code on both
@dotnet/ncl please confirm that the added parameters make sense (not just to me) -- this is akin to adding a public API.
|
src/libraries/System.Net.Http/src/System/Net/Http/HttpMessageInvoker.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/HttpTelemetry.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.
A couple of questions, but overall looks good.
src/libraries/System.Net.Http/src/System/Net/Http/HttpTelemetry.cs
Outdated
Show resolved
Hide resolved
Not directly related to this change, but are these kinds of events already exposed in a first class way to open telemetry? I'm just wondering whether we expect we'd need work in this codebase analogous to what @JamesNK is doing in dotnet/aspnetcore#46834 |
The events are exposed in the sense that OpenTelemetry instrumentation could create an EventListener and receive them if it wants to. Currently OTel's HttpClient instrumentation doesn't do that as it utilizes some DianosticSource events instead: https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.Http. |
fe48bce
to
e9eb374
Compare
@dotnet/ncl PTAL, the change is now:
|
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
@noahfalk mind taking another look at this one if it matches what you'd expect? This is also the first time for networking telemetry that we're making use of Keywords/Version, I just followed existing patterns there w.r.t. naming. |
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.
Functionally this looks fine to me, my only remaining concern is have we validated with Jeff that this meets his needs? For example I could speculate he may not want the overhead/risk of the detailed error message with full stack trace, but perhaps he would still want the Exception type name as part of the error information?
I'll double-check offline, but with HttpClient the exception type name alone is not useful - it should be either |
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
Contributes to #83734
This PR adds the following parameters to existing events:
and a new event under a dedicated keyword
Copying the reasoning behind having the status code on both
RequestStop
andResponseHeadersStop
from #83734 (comment):@dotnet/ncl please confirm that the added parameters make sense (not just to me) -- this is akin to adding a public API in that we don't want to break it in the future (we can add more parameters, but wouldn't want to remove them for example).