Skip to content

Commit

Permalink
Fixed Missing Endpoint
Browse files Browse the repository at this point in the history
When an exception if processed by the ExceptionHandler middleware the original endpoint is deleted
  • Loading branch information
cliedeman committed Dec 6, 2023
1 parent a963ec8 commit c2fd145
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

namespace OpenTelemetry.Instrumentation.AspNetCore.Implementation;

using Microsoft.AspNetCore.Diagnostics;

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net462)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net462)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-report (windows-latest)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-report (windows-latest)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net462)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net462)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check warning on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / check-format-stable

Using directive is unnecessary.

Check warning on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / check-format-stable

Using directive is unnecessary.

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check warning on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / check-format-experimental

Using directive is unnecessary.

Check warning on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / check-format-experimental

Using directive is unnecessary.

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net462)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 38 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net462)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

internal class HttpInListener : ListenerHandler
{
internal const string ActivityOperationName = "Microsoft.AspNetCore.Hosting.HttpRequestIn";
Expand Down Expand Up @@ -243,7 +245,8 @@ public void OnStopActivity(Activity activity, object payload)
var response = context.Response;

#if !NETSTANDARD
var routePattern = (context.GetEndpoint() as RouteEndpoint)?.RoutePattern.RawText;
var routePattern = (context.Features.Get<IExceptionHandlerPathFeature>().Endpoint as RouteEndpoint)?.RoutePattern.RawText ??
(context.GetEndpoint() as RouteEndpoint)?.RoutePattern.RawText;
if (!string.IsNullOrEmpty(routePattern))
{
activity.DisplayName = this.GetDisplayName(context.Request.Method, routePattern);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

namespace OpenTelemetry.Instrumentation.AspNetCore.Implementation;

using Microsoft.AspNetCore.Diagnostics;

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net462)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net462)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-report (windows-latest)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-report (windows-latest)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net8.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net7.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net462)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net462)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check warning on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / check-format-stable

Using directive is unnecessary.

Check warning on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / check-format-stable

Using directive is unnecessary.

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net6.0)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check warning on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / check-format-experimental

Using directive is unnecessary.

Check warning on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / check-format-experimental

Using directive is unnecessary.

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-stable

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net462)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

Check failure on line 31 in src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net462)

The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

internal sealed class HttpInMetricsListener : ListenerHandler
{
internal const string HttpServerRequestDurationMetricName = "http.server.request.duration";
Expand Down Expand Up @@ -121,7 +123,9 @@ public void OnStopEventWritten(string name, object payload)
tags.Add(new KeyValuePair<string, object>(SemanticConventions.AttributeHttpRequestMethod, httpMethod));

#if NET6_0_OR_GREATER
var route = (context.GetEndpoint() as RouteEndpoint)?.RoutePattern.RawText;
// Check the exception handler feature first in case the endpoint was overwritten
var route = (context.Features.Get<IExceptionHandlerPathFeature>().Endpoint as RouteEndpoint)?.RoutePattern.RawText ??
(context.GetEndpoint() as RouteEndpoint)?.RoutePattern.RawText;
if (!string.IsNullOrEmpty(route))
{
tags.Add(new KeyValuePair<string, object>(SemanticConventions.AttributeHttpRoute, route));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,15 @@
"expectedStatusCode": 200,
"currentHttpRoute": null,
"expectedHttpRoute": "/MinimalApiUsingMapGroup/{id}"
},
{
"name": "Exception Handled by Exception HAndler",
"minimumDotnetVersion": 7,
"testApplicationScenario": "MinimalApi",
"httpMethod": "GET",
"path": "/MinimalApiException",
"expectedStatusCode": 200,
"currentHttpRoute": null,
"expectedHttpRoute": "/MinimalApiException"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,13 @@ private static WebApplication CreateMinimalApiApplication()
builder.Logging.ClearProviders();

var app = builder.Build();
app.UseExceptionHandler();
app.Urls.Clear();
app.Urls.Add("http://[::1]:0");

app.MapGet("/MinimalApi", () => Results.Ok());
app.MapGet("/MinimalApi/{id}", (int id) => Results.Ok());
app.MapGet("/MinimalApiException", (ctx) => throw new ApplicationException());

#if NET7_0_OR_GREATER
var api = app.MapGroup("/MinimalApiUsingMapGroup");
Expand Down

0 comments on commit c2fd145

Please sign in to comment.