You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Runtime version (e.g. net462, net48, netcoreapp3.1, net6.0 etc. You can
find this information from the *.csproj file):
net8
Symptom
A clear and concise description of what the bug is.
What is the expected behavior?
http.route should always be populated, regardless of if the route handler threw an exception or not.
What is the actual behavior?
http.route is only populated when there's no exception; the tag is null when an exception occurs.
Reproduce
In lieu of a reproduction repo, I can point to the likely cause, which is a discrepancy between how the metrics instrumentation handles http.route compared to the tracing instrumentation.
Ah and you also mentioned that you're using net8. The instrumentation in this repository only emits metrics for net6 and net7. With net8 the http.server.request.duration metric is emitted natively by the ASP.NET Core itself.
Fixed an issue where the http.route attribute was not set on either the Activity or http.server.request.duration metric generated from a request when an exception handling middleware is invoked. One caveat is that this fix does not address the problem for the http.server.request.duration metric when running ASP.NET Core 8. ASP.NET Core 8 contains an equivalent fix which should ship in version 8.0.2 (see: dotnet/aspnetcore#52652). (#5135).
Bug Report
List of all OpenTelemetry NuGet
packages and version that you are
using (e.g.
OpenTelemetry 1.0.2
):OpenTelemetry 1.7.0
OpenTelemetry.Instrumentation.AspNetCore 1.7.0
Runtime version (e.g.
net462
,net48
,netcoreapp3.1
,net6.0
etc. You canfind this information from the
*.csproj
file):Symptom
A clear and concise description of what the bug is.
What is the expected behavior?
http.route
should always be populated, regardless of if the route handler threw an exception or not.What is the actual behavior?
http.route
is only populated when there's no exception; the tag is null when an exception occurs.Reproduce
In lieu of a reproduction repo, I can point to the likely cause, which is a discrepancy between how the metrics instrumentation handles http.route compared to the tracing instrumentation.
opentelemetry-dotnet/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs
Lines 90 to 96 in 84bdeb3
context.Features.Get<IExceptionHandlerPathFeature>()?.Endpoint
first, falling back tocontext.GetEndpoint()
opentelemetry-dotnet/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs
Lines 246 to 252 in 84bdeb3
context.GetEndpoint()
I'd assume the metrics way is correct, but am not positive 🤷♂️
The text was updated successfully, but these errors were encountered: