-
Notifications
You must be signed in to change notification settings - Fork 0
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
.NET Framework HttpClient metrics #1
Conversation
…ensley/opentelemetry-dotnet into net462httpclientmetricsv3
src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs
Show resolved
Hide resolved
|
||
if (httpStatusCode.HasValue) | ||
{ | ||
HttpClientDuration.Record( |
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.
Worth asking upstream (on the channel or in the SIG meeting), but I think that metric generation for .NET and .NET framework should be consistent. Which means, we should support flags for emitting old or new attributes: https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs#L67C20-L67C20
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.
Can ask in the SIG. For the OWIN metrics PR, they requested I use new attribute names. They did not ask to support both, so tbd.
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, OWIN didn't send any metrics at all, so going just with the new ones there seems fine to me.
However, for HttpClient, there are already metrics emitted for .NET. I think it would be awkward if HttpClient would emit different metrics for .NET and .NET framework.
src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs
Outdated
Show resolved
Hide resolved
…ensley/opentelemetry-dotnet into net462httpclientmetricsv3 # Conflicts: # src/OpenTelemetry.Instrumentation.Http/MeterProviderBuilderExtensions.cs
src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs
Outdated
Show resolved
Hide resolved
…equestActivitySource.netfx.cs Co-authored-by: Johannes Tax <johannes@johannes.tax>
…ensley/opentelemetry-dotnet into net462httpclientmetricsv3
…equestActivitySource.netfx.cs Co-authored-by: Johannes Tax <johannes@johannes.tax>
…equestActivitySource.netfx.cs Co-authored-by: Johannes Tax <johannes@johannes.tax>
…ensley/opentelemetry-dotnet into net462httpclientmetricsv3
Adds HttpClient metrics for .NET Framework 4.6.2 and newer. This implementation does not rely on tracing at all, and can be used without traces being sampled/recorded.
TODO
Metrics only testsNo metrics / no traces testsMetrics + traces matching testsMetrics generation when there is an exceptionDuration from stopwatch when the activity is null