diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net6.0.md b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net6.0.md index ac9ff0d5117..7ce134a6d6c 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net6.0.md +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net6.0.md @@ -1,35 +1,35 @@ # Test results for ASP.NET Core 6 -| Span http.route | Metric http.route | App | Test Name | -| - | - | - | - | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Root path](#conventionalrouting-root-path) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Non-default action with route parameter and query string](#conventionalrouting-non-default-action-with-route-parameter-and-query-string) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Non-default action with query string](#conventionalrouting-non-default-action-with-query-string) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Not Found (404)](#conventionalrouting-not-found-404) | -| :broken_heart: | :green_heart: | ConventionalRouting | [Route template with parameter constraint](#conventionalrouting-route-template-with-parameter-constraint) | -| :broken_heart: | :green_heart: | ConventionalRouting | [Path that does not match parameter constraint](#conventionalrouting-path-that-does-not-match-parameter-constraint) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Area using area:exists, default controller/action](#conventionalrouting-area-using-areaexists-default-controlleraction) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Area using area:exists, non-default action](#conventionalrouting-area-using-areaexists-non-default-action) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Area w/o area:exists, default controller/action](#conventionalrouting-area-wo-areaexists-default-controlleraction) | -| :green_heart: | :green_heart: | AttributeRouting | [Default action](#attributerouting-default-action) | -| :green_heart: | :green_heart: | AttributeRouting | [Action without parameter](#attributerouting-action-without-parameter) | -| :green_heart: | :green_heart: | AttributeRouting | [Action with parameter](#attributerouting-action-with-parameter) | -| :green_heart: | :green_heart: | AttributeRouting | [Action with parameter before action name in template](#attributerouting-action-with-parameter-before-action-name-in-template) | -| :green_heart: | :green_heart: | AttributeRouting | [Action invoked resulting in 400 Bad Request](#attributerouting-action-invoked-resulting-in-400-bad-request) | -| :broken_heart: | :broken_heart: | RazorPages | [Root path](#razorpages-root-path) | -| :broken_heart: | :broken_heart: | RazorPages | [Index page](#razorpages-index-page) | -| :broken_heart: | :broken_heart: | RazorPages | [Throws exception](#razorpages-throws-exception) | -| :green_heart: | :green_heart: | RazorPages | [Static content](#razorpages-static-content) | -| :broken_heart: | :green_heart: | MinimalApi | [Action without parameter](#minimalapi-action-without-parameter) | -| :broken_heart: | :green_heart: | MinimalApi | [Action with parameter](#minimalapi-action-with-parameter) | +| Metric http.route | App | Test Name | +| - | - | - | +| :broken_heart: | ConventionalRouting | [Root path](#conventionalrouting-root-path) | +| :broken_heart: | ConventionalRouting | [Non-default action with route parameter and query string](#conventionalrouting-non-default-action-with-route-parameter-and-query-string) | +| :broken_heart: | ConventionalRouting | [Non-default action with query string](#conventionalrouting-non-default-action-with-query-string) | +| :broken_heart: | ConventionalRouting | [Not Found (404)](#conventionalrouting-not-found-404) | +| :green_heart: | ConventionalRouting | [Route template with parameter constraint](#conventionalrouting-route-template-with-parameter-constraint) | +| :green_heart: | ConventionalRouting | [Path that does not match parameter constraint](#conventionalrouting-path-that-does-not-match-parameter-constraint) | +| :broken_heart: | ConventionalRouting | [Area using area:exists, default controller/action](#conventionalrouting-area-using-areaexists-default-controlleraction) | +| :broken_heart: | ConventionalRouting | [Area using area:exists, non-default action](#conventionalrouting-area-using-areaexists-non-default-action) | +| :broken_heart: | ConventionalRouting | [Area w/o area:exists, default controller/action](#conventionalrouting-area-wo-areaexists-default-controlleraction) | +| :green_heart: | AttributeRouting | [Default action](#attributerouting-default-action) | +| :green_heart: | AttributeRouting | [Action without parameter](#attributerouting-action-without-parameter) | +| :green_heart: | AttributeRouting | [Action with parameter](#attributerouting-action-with-parameter) | +| :green_heart: | AttributeRouting | [Action with parameter before action name in template](#attributerouting-action-with-parameter-before-action-name-in-template) | +| :green_heart: | AttributeRouting | [Action invoked resulting in 400 Bad Request](#attributerouting-action-invoked-resulting-in-400-bad-request) | +| :broken_heart: | RazorPages | [Root path](#razorpages-root-path) | +| :broken_heart: | RazorPages | [Index page](#razorpages-index-page) | +| :broken_heart: | RazorPages | [Throws exception](#razorpages-throws-exception) | +| :green_heart: | RazorPages | [Static content](#razorpages-static-content) | +| :green_heart: | MinimalApi | [Action without parameter](#minimalapi-action-without-parameter) | +| :green_heart: | MinimalApi | [Action with parameter](#minimalapi-action-with-parameter) | ## ConventionalRouting: Root path ```json { "IdealHttpRoute": "ConventionalRoute/Default/{id?}", - "ActivityDisplayName": "/", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET ConventionalRoute/Default/{id?}", + "ActivityHttpRoute": "ConventionalRoute/Default/{id?}", "MetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -58,8 +58,8 @@ ```json { "IdealHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", - "ActivityDisplayName": "/ConventionalRoute/ActionWithStringParameter/2", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET ConventionalRoute/ActionWithStringParameter/{id?}", + "ActivityHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", "MetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -92,8 +92,8 @@ ```json { "IdealHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", - "ActivityDisplayName": "/ConventionalRoute/ActionWithStringParameter", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET ConventionalRoute/ActionWithStringParameter/{id?}", + "ActivityHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", "MetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -125,7 +125,7 @@ ```json { "IdealHttpRoute": "", - "ActivityDisplayName": "/ConventionalRoute/NotFound", + "ActivityDisplayName": "GET", "ActivityHttpRoute": "", "MetricHttpRoute": "", "RouteInfo": { @@ -144,8 +144,8 @@ ```json { "IdealHttpRoute": "SomePath/{id}/{num:int}", - "ActivityDisplayName": "/SomePath/SomeString/2", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET SomePath/{id}/{num:int}", + "ActivityHttpRoute": "SomePath/{id}/{num:int}", "MetricHttpRoute": "SomePath/{id}/{num:int}", "RouteInfo": { "HttpMethod": "GET", @@ -179,7 +179,7 @@ ```json { "IdealHttpRoute": "", - "ActivityDisplayName": "/SomePath/SomeString/NotAnInt", + "ActivityDisplayName": "GET", "ActivityHttpRoute": "", "MetricHttpRoute": "", "RouteInfo": { @@ -198,8 +198,8 @@ ```json { "IdealHttpRoute": "{area:exists}/ControllerForMyArea/Default/{id?}", - "ActivityDisplayName": "/MyArea", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET {area:exists}/ControllerForMyArea/Default/{id?}", + "ActivityHttpRoute": "{area:exists}/ControllerForMyArea/Default/{id?}", "MetricHttpRoute": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -229,8 +229,8 @@ ```json { "IdealHttpRoute": "{area:exists}/ControllerForMyArea/NonDefault/{id?}", - "ActivityDisplayName": "/MyArea/ControllerForMyArea/NonDefault", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET {area:exists}/ControllerForMyArea/NonDefault/{id?}", + "ActivityHttpRoute": "{area:exists}/ControllerForMyArea/NonDefault/{id?}", "MetricHttpRoute": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -260,8 +260,8 @@ ```json { "IdealHttpRoute": "SomePrefix/AnotherArea/Index/{id?}", - "ActivityDisplayName": "/SomePrefix", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET SomePrefix/AnotherArea/Index/{id?}", + "ActivityHttpRoute": "SomePrefix/AnotherArea/Index/{id?}", "MetricHttpRoute": "SomePrefix/{controller=AnotherArea}/{action=Index}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -291,7 +291,7 @@ ```json { "IdealHttpRoute": "AttributeRoute", - "ActivityDisplayName": "AttributeRoute", + "ActivityDisplayName": "GET AttributeRoute", "ActivityHttpRoute": "AttributeRoute", "MetricHttpRoute": "AttributeRoute", "RouteInfo": { @@ -321,7 +321,7 @@ ```json { "IdealHttpRoute": "AttributeRoute/Get", - "ActivityDisplayName": "AttributeRoute/Get", + "ActivityDisplayName": "GET AttributeRoute/Get", "ActivityHttpRoute": "AttributeRoute/Get", "MetricHttpRoute": "AttributeRoute/Get", "RouteInfo": { @@ -351,7 +351,7 @@ ```json { "IdealHttpRoute": "AttributeRoute/Get/{id}", - "ActivityDisplayName": "AttributeRoute/Get/{id}", + "ActivityDisplayName": "GET AttributeRoute/Get/{id}", "ActivityHttpRoute": "AttributeRoute/Get/{id}", "MetricHttpRoute": "AttributeRoute/Get/{id}", "RouteInfo": { @@ -384,7 +384,7 @@ ```json { "IdealHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "ActivityDisplayName": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", + "ActivityDisplayName": "GET AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "ActivityHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "MetricHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "RouteInfo": { @@ -417,7 +417,7 @@ ```json { "IdealHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "ActivityDisplayName": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", + "ActivityDisplayName": "GET AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "ActivityHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "MetricHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "RouteInfo": { @@ -450,8 +450,8 @@ ```json { "IdealHttpRoute": "/Index", - "ActivityDisplayName": "/", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET /Index", + "ActivityHttpRoute": "/Index", "MetricHttpRoute": "", "RouteInfo": { "HttpMethod": "GET", @@ -479,8 +479,8 @@ ```json { "IdealHttpRoute": "/Index", - "ActivityDisplayName": "Index", - "ActivityHttpRoute": "Index", + "ActivityDisplayName": "GET /Index", + "ActivityHttpRoute": "/Index", "MetricHttpRoute": "Index", "RouteInfo": { "HttpMethod": "GET", @@ -508,8 +508,8 @@ ```json { "IdealHttpRoute": "/PageThatThrowsException", - "ActivityDisplayName": "PageThatThrowsException", - "ActivityHttpRoute": "PageThatThrowsException", + "ActivityDisplayName": "GET /PageThatThrowsException", + "ActivityHttpRoute": "/PageThatThrowsException", "MetricHttpRoute": "PageThatThrowsException", "RouteInfo": { "HttpMethod": "GET", @@ -537,7 +537,7 @@ ```json { "IdealHttpRoute": "", - "ActivityDisplayName": "/js/site.js", + "ActivityDisplayName": "GET", "ActivityHttpRoute": "", "MetricHttpRoute": "", "RouteInfo": { @@ -556,8 +556,8 @@ ```json { "IdealHttpRoute": "/MinimalApi", - "ActivityDisplayName": "/MinimalApi", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET /MinimalApi", + "ActivityHttpRoute": "/MinimalApi", "MetricHttpRoute": "/MinimalApi", "RouteInfo": { "HttpMethod": "GET", @@ -575,8 +575,8 @@ ```json { "IdealHttpRoute": "/MinimalApi/{id}", - "ActivityDisplayName": "/MinimalApi/123", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET /MinimalApi/{id}", + "ActivityHttpRoute": "/MinimalApi/{id}", "MetricHttpRoute": "/MinimalApi/{id}", "RouteInfo": { "HttpMethod": "GET", diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net7.0.md b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net7.0.md index f93e5de8ea8..0d544536e24 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net7.0.md +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net7.0.md @@ -1,37 +1,37 @@ # Test results for ASP.NET Core 7 -| Span http.route | Metric http.route | App | Test Name | -| - | - | - | - | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Root path](#conventionalrouting-root-path) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Non-default action with route parameter and query string](#conventionalrouting-non-default-action-with-route-parameter-and-query-string) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Non-default action with query string](#conventionalrouting-non-default-action-with-query-string) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Not Found (404)](#conventionalrouting-not-found-404) | -| :broken_heart: | :green_heart: | ConventionalRouting | [Route template with parameter constraint](#conventionalrouting-route-template-with-parameter-constraint) | -| :broken_heart: | :green_heart: | ConventionalRouting | [Path that does not match parameter constraint](#conventionalrouting-path-that-does-not-match-parameter-constraint) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Area using area:exists, default controller/action](#conventionalrouting-area-using-areaexists-default-controlleraction) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Area using area:exists, non-default action](#conventionalrouting-area-using-areaexists-non-default-action) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Area w/o area:exists, default controller/action](#conventionalrouting-area-wo-areaexists-default-controlleraction) | -| :green_heart: | :green_heart: | AttributeRouting | [Default action](#attributerouting-default-action) | -| :green_heart: | :green_heart: | AttributeRouting | [Action without parameter](#attributerouting-action-without-parameter) | -| :green_heart: | :green_heart: | AttributeRouting | [Action with parameter](#attributerouting-action-with-parameter) | -| :green_heart: | :green_heart: | AttributeRouting | [Action with parameter before action name in template](#attributerouting-action-with-parameter-before-action-name-in-template) | -| :green_heart: | :green_heart: | AttributeRouting | [Action invoked resulting in 400 Bad Request](#attributerouting-action-invoked-resulting-in-400-bad-request) | -| :broken_heart: | :broken_heart: | RazorPages | [Root path](#razorpages-root-path) | -| :broken_heart: | :broken_heart: | RazorPages | [Index page](#razorpages-index-page) | -| :broken_heart: | :broken_heart: | RazorPages | [Throws exception](#razorpages-throws-exception) | -| :green_heart: | :green_heart: | RazorPages | [Static content](#razorpages-static-content) | -| :broken_heart: | :green_heart: | MinimalApi | [Action without parameter](#minimalapi-action-without-parameter) | -| :broken_heart: | :green_heart: | MinimalApi | [Action with parameter](#minimalapi-action-with-parameter) | -| :broken_heart: | :green_heart: | MinimalApi | [Action without parameter (MapGroup)](#minimalapi-action-without-parameter-mapgroup) | -| :broken_heart: | :green_heart: | MinimalApi | [Action with parameter (MapGroup)](#minimalapi-action-with-parameter-mapgroup) | +| Metric http.route | App | Test Name | +| - | - | - | +| :broken_heart: | ConventionalRouting | [Root path](#conventionalrouting-root-path) | +| :broken_heart: | ConventionalRouting | [Non-default action with route parameter and query string](#conventionalrouting-non-default-action-with-route-parameter-and-query-string) | +| :broken_heart: | ConventionalRouting | [Non-default action with query string](#conventionalrouting-non-default-action-with-query-string) | +| :broken_heart: | ConventionalRouting | [Not Found (404)](#conventionalrouting-not-found-404) | +| :green_heart: | ConventionalRouting | [Route template with parameter constraint](#conventionalrouting-route-template-with-parameter-constraint) | +| :green_heart: | ConventionalRouting | [Path that does not match parameter constraint](#conventionalrouting-path-that-does-not-match-parameter-constraint) | +| :broken_heart: | ConventionalRouting | [Area using area:exists, default controller/action](#conventionalrouting-area-using-areaexists-default-controlleraction) | +| :broken_heart: | ConventionalRouting | [Area using area:exists, non-default action](#conventionalrouting-area-using-areaexists-non-default-action) | +| :broken_heart: | ConventionalRouting | [Area w/o area:exists, default controller/action](#conventionalrouting-area-wo-areaexists-default-controlleraction) | +| :green_heart: | AttributeRouting | [Default action](#attributerouting-default-action) | +| :green_heart: | AttributeRouting | [Action without parameter](#attributerouting-action-without-parameter) | +| :green_heart: | AttributeRouting | [Action with parameter](#attributerouting-action-with-parameter) | +| :green_heart: | AttributeRouting | [Action with parameter before action name in template](#attributerouting-action-with-parameter-before-action-name-in-template) | +| :green_heart: | AttributeRouting | [Action invoked resulting in 400 Bad Request](#attributerouting-action-invoked-resulting-in-400-bad-request) | +| :broken_heart: | RazorPages | [Root path](#razorpages-root-path) | +| :broken_heart: | RazorPages | [Index page](#razorpages-index-page) | +| :broken_heart: | RazorPages | [Throws exception](#razorpages-throws-exception) | +| :green_heart: | RazorPages | [Static content](#razorpages-static-content) | +| :green_heart: | MinimalApi | [Action without parameter](#minimalapi-action-without-parameter) | +| :green_heart: | MinimalApi | [Action with parameter](#minimalapi-action-with-parameter) | +| :green_heart: | MinimalApi | [Action without parameter (MapGroup)](#minimalapi-action-without-parameter-mapgroup) | +| :green_heart: | MinimalApi | [Action with parameter (MapGroup)](#minimalapi-action-with-parameter-mapgroup) | ## ConventionalRouting: Root path ```json { "IdealHttpRoute": "ConventionalRoute/Default/{id?}", - "ActivityDisplayName": "/", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET ConventionalRoute/Default/{id?}", + "ActivityHttpRoute": "ConventionalRoute/Default/{id?}", "MetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -60,8 +60,8 @@ ```json { "IdealHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", - "ActivityDisplayName": "/ConventionalRoute/ActionWithStringParameter/2", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET ConventionalRoute/ActionWithStringParameter/{id?}", + "ActivityHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", "MetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -94,8 +94,8 @@ ```json { "IdealHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", - "ActivityDisplayName": "/ConventionalRoute/ActionWithStringParameter", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET ConventionalRoute/ActionWithStringParameter/{id?}", + "ActivityHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", "MetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -127,7 +127,7 @@ ```json { "IdealHttpRoute": "", - "ActivityDisplayName": "/ConventionalRoute/NotFound", + "ActivityDisplayName": "GET", "ActivityHttpRoute": "", "MetricHttpRoute": "", "RouteInfo": { @@ -146,8 +146,8 @@ ```json { "IdealHttpRoute": "SomePath/{id}/{num:int}", - "ActivityDisplayName": "/SomePath/SomeString/2", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET SomePath/{id}/{num:int}", + "ActivityHttpRoute": "SomePath/{id}/{num:int}", "MetricHttpRoute": "SomePath/{id}/{num:int}", "RouteInfo": { "HttpMethod": "GET", @@ -181,7 +181,7 @@ ```json { "IdealHttpRoute": "", - "ActivityDisplayName": "/SomePath/SomeString/NotAnInt", + "ActivityDisplayName": "GET", "ActivityHttpRoute": "", "MetricHttpRoute": "", "RouteInfo": { @@ -200,8 +200,8 @@ ```json { "IdealHttpRoute": "{area:exists}/ControllerForMyArea/Default/{id?}", - "ActivityDisplayName": "/MyArea", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET {area:exists}/ControllerForMyArea/Default/{id?}", + "ActivityHttpRoute": "{area:exists}/ControllerForMyArea/Default/{id?}", "MetricHttpRoute": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -231,8 +231,8 @@ ```json { "IdealHttpRoute": "{area:exists}/ControllerForMyArea/NonDefault/{id?}", - "ActivityDisplayName": "/MyArea/ControllerForMyArea/NonDefault", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET {area:exists}/ControllerForMyArea/NonDefault/{id?}", + "ActivityHttpRoute": "{area:exists}/ControllerForMyArea/NonDefault/{id?}", "MetricHttpRoute": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -262,8 +262,8 @@ ```json { "IdealHttpRoute": "SomePrefix/AnotherArea/Index/{id?}", - "ActivityDisplayName": "/SomePrefix", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET SomePrefix/AnotherArea/Index/{id?}", + "ActivityHttpRoute": "SomePrefix/AnotherArea/Index/{id?}", "MetricHttpRoute": "SomePrefix/{controller=AnotherArea}/{action=Index}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -293,7 +293,7 @@ ```json { "IdealHttpRoute": "AttributeRoute", - "ActivityDisplayName": "AttributeRoute", + "ActivityDisplayName": "GET AttributeRoute", "ActivityHttpRoute": "AttributeRoute", "MetricHttpRoute": "AttributeRoute", "RouteInfo": { @@ -323,7 +323,7 @@ ```json { "IdealHttpRoute": "AttributeRoute/Get", - "ActivityDisplayName": "AttributeRoute/Get", + "ActivityDisplayName": "GET AttributeRoute/Get", "ActivityHttpRoute": "AttributeRoute/Get", "MetricHttpRoute": "AttributeRoute/Get", "RouteInfo": { @@ -353,7 +353,7 @@ ```json { "IdealHttpRoute": "AttributeRoute/Get/{id}", - "ActivityDisplayName": "AttributeRoute/Get/{id}", + "ActivityDisplayName": "GET AttributeRoute/Get/{id}", "ActivityHttpRoute": "AttributeRoute/Get/{id}", "MetricHttpRoute": "AttributeRoute/Get/{id}", "RouteInfo": { @@ -386,7 +386,7 @@ ```json { "IdealHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "ActivityDisplayName": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", + "ActivityDisplayName": "GET AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "ActivityHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "MetricHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "RouteInfo": { @@ -419,7 +419,7 @@ ```json { "IdealHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "ActivityDisplayName": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", + "ActivityDisplayName": "GET AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "ActivityHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "MetricHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "RouteInfo": { @@ -452,8 +452,8 @@ ```json { "IdealHttpRoute": "/Index", - "ActivityDisplayName": "/", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET /Index", + "ActivityHttpRoute": "/Index", "MetricHttpRoute": "", "RouteInfo": { "HttpMethod": "GET", @@ -481,8 +481,8 @@ ```json { "IdealHttpRoute": "/Index", - "ActivityDisplayName": "Index", - "ActivityHttpRoute": "Index", + "ActivityDisplayName": "GET /Index", + "ActivityHttpRoute": "/Index", "MetricHttpRoute": "Index", "RouteInfo": { "HttpMethod": "GET", @@ -510,8 +510,8 @@ ```json { "IdealHttpRoute": "/PageThatThrowsException", - "ActivityDisplayName": "PageThatThrowsException", - "ActivityHttpRoute": "PageThatThrowsException", + "ActivityDisplayName": "GET /PageThatThrowsException", + "ActivityHttpRoute": "/PageThatThrowsException", "MetricHttpRoute": "PageThatThrowsException", "RouteInfo": { "HttpMethod": "GET", @@ -539,7 +539,7 @@ ```json { "IdealHttpRoute": "", - "ActivityDisplayName": "/js/site.js", + "ActivityDisplayName": "GET", "ActivityHttpRoute": "", "MetricHttpRoute": "", "RouteInfo": { @@ -558,8 +558,8 @@ ```json { "IdealHttpRoute": "/MinimalApi", - "ActivityDisplayName": "/MinimalApi", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET /MinimalApi", + "ActivityHttpRoute": "/MinimalApi", "MetricHttpRoute": "/MinimalApi", "RouteInfo": { "HttpMethod": "GET", @@ -577,8 +577,8 @@ ```json { "IdealHttpRoute": "/MinimalApi/{id}", - "ActivityDisplayName": "/MinimalApi/123", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET /MinimalApi/{id}", + "ActivityHttpRoute": "/MinimalApi/{id}", "MetricHttpRoute": "/MinimalApi/{id}", "RouteInfo": { "HttpMethod": "GET", @@ -598,8 +598,8 @@ ```json { "IdealHttpRoute": "/MinimalApiUsingMapGroup/", - "ActivityDisplayName": "/MinimalApiUsingMapGroup", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET /MinimalApiUsingMapGroup/", + "ActivityHttpRoute": "/MinimalApiUsingMapGroup/", "MetricHttpRoute": "/MinimalApiUsingMapGroup/", "RouteInfo": { "HttpMethod": "GET", @@ -617,8 +617,8 @@ ```json { "IdealHttpRoute": "/MinimalApiUsingMapGroup/{id}", - "ActivityDisplayName": "/MinimalApiUsingMapGroup/123", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET /MinimalApiUsingMapGroup/{id}", + "ActivityHttpRoute": "/MinimalApiUsingMapGroup/{id}", "MetricHttpRoute": "/MinimalApiUsingMapGroup/{id}", "RouteInfo": { "HttpMethod": "GET", diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net8.0.md b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net8.0.md index 4cacc1eac0c..6814e43c28c 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net8.0.md +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net8.0.md @@ -1,37 +1,37 @@ # Test results for ASP.NET Core 8 -| Span http.route | Metric http.route | App | Test Name | -| - | - | - | - | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Root path](#conventionalrouting-root-path) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Non-default action with route parameter and query string](#conventionalrouting-non-default-action-with-route-parameter-and-query-string) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Non-default action with query string](#conventionalrouting-non-default-action-with-query-string) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Not Found (404)](#conventionalrouting-not-found-404) | -| :broken_heart: | :green_heart: | ConventionalRouting | [Route template with parameter constraint](#conventionalrouting-route-template-with-parameter-constraint) | -| :broken_heart: | :green_heart: | ConventionalRouting | [Path that does not match parameter constraint](#conventionalrouting-path-that-does-not-match-parameter-constraint) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Area using area:exists, default controller/action](#conventionalrouting-area-using-areaexists-default-controlleraction) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Area using area:exists, non-default action](#conventionalrouting-area-using-areaexists-non-default-action) | -| :broken_heart: | :broken_heart: | ConventionalRouting | [Area w/o area:exists, default controller/action](#conventionalrouting-area-wo-areaexists-default-controlleraction) | -| :green_heart: | :green_heart: | AttributeRouting | [Default action](#attributerouting-default-action) | -| :green_heart: | :green_heart: | AttributeRouting | [Action without parameter](#attributerouting-action-without-parameter) | -| :green_heart: | :green_heart: | AttributeRouting | [Action with parameter](#attributerouting-action-with-parameter) | -| :green_heart: | :green_heart: | AttributeRouting | [Action with parameter before action name in template](#attributerouting-action-with-parameter-before-action-name-in-template) | -| :green_heart: | :green_heart: | AttributeRouting | [Action invoked resulting in 400 Bad Request](#attributerouting-action-invoked-resulting-in-400-bad-request) | -| :broken_heart: | :broken_heart: | RazorPages | [Root path](#razorpages-root-path) | -| :broken_heart: | :broken_heart: | RazorPages | [Index page](#razorpages-index-page) | -| :broken_heart: | :broken_heart: | RazorPages | [Throws exception](#razorpages-throws-exception) | -| :green_heart: | :green_heart: | RazorPages | [Static content](#razorpages-static-content) | -| :broken_heart: | :green_heart: | MinimalApi | [Action without parameter](#minimalapi-action-without-parameter) | -| :broken_heart: | :green_heart: | MinimalApi | [Action with parameter](#minimalapi-action-with-parameter) | -| :broken_heart: | :green_heart: | MinimalApi | [Action without parameter (MapGroup)](#minimalapi-action-without-parameter-mapgroup) | -| :broken_heart: | :green_heart: | MinimalApi | [Action with parameter (MapGroup)](#minimalapi-action-with-parameter-mapgroup) | +| Metric http.route | App | Test Name | +| - | - | - | +| :broken_heart: | ConventionalRouting | [Root path](#conventionalrouting-root-path) | +| :broken_heart: | ConventionalRouting | [Non-default action with route parameter and query string](#conventionalrouting-non-default-action-with-route-parameter-and-query-string) | +| :broken_heart: | ConventionalRouting | [Non-default action with query string](#conventionalrouting-non-default-action-with-query-string) | +| :broken_heart: | ConventionalRouting | [Not Found (404)](#conventionalrouting-not-found-404) | +| :green_heart: | ConventionalRouting | [Route template with parameter constraint](#conventionalrouting-route-template-with-parameter-constraint) | +| :green_heart: | ConventionalRouting | [Path that does not match parameter constraint](#conventionalrouting-path-that-does-not-match-parameter-constraint) | +| :broken_heart: | ConventionalRouting | [Area using area:exists, default controller/action](#conventionalrouting-area-using-areaexists-default-controlleraction) | +| :broken_heart: | ConventionalRouting | [Area using area:exists, non-default action](#conventionalrouting-area-using-areaexists-non-default-action) | +| :broken_heart: | ConventionalRouting | [Area w/o area:exists, default controller/action](#conventionalrouting-area-wo-areaexists-default-controlleraction) | +| :green_heart: | AttributeRouting | [Default action](#attributerouting-default-action) | +| :green_heart: | AttributeRouting | [Action without parameter](#attributerouting-action-without-parameter) | +| :green_heart: | AttributeRouting | [Action with parameter](#attributerouting-action-with-parameter) | +| :green_heart: | AttributeRouting | [Action with parameter before action name in template](#attributerouting-action-with-parameter-before-action-name-in-template) | +| :green_heart: | AttributeRouting | [Action invoked resulting in 400 Bad Request](#attributerouting-action-invoked-resulting-in-400-bad-request) | +| :broken_heart: | RazorPages | [Root path](#razorpages-root-path) | +| :broken_heart: | RazorPages | [Index page](#razorpages-index-page) | +| :broken_heart: | RazorPages | [Throws exception](#razorpages-throws-exception) | +| :green_heart: | RazorPages | [Static content](#razorpages-static-content) | +| :green_heart: | MinimalApi | [Action without parameter](#minimalapi-action-without-parameter) | +| :green_heart: | MinimalApi | [Action with parameter](#minimalapi-action-with-parameter) | +| :green_heart: | MinimalApi | [Action without parameter (MapGroup)](#minimalapi-action-without-parameter-mapgroup) | +| :green_heart: | MinimalApi | [Action with parameter (MapGroup)](#minimalapi-action-with-parameter-mapgroup) | ## ConventionalRouting: Root path ```json { "IdealHttpRoute": "ConventionalRoute/Default/{id?}", - "ActivityDisplayName": "/", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET ConventionalRoute/Default/{id?}", + "ActivityHttpRoute": "ConventionalRoute/Default/{id?}", "MetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -60,8 +60,8 @@ ```json { "IdealHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", - "ActivityDisplayName": "/ConventionalRoute/ActionWithStringParameter/2", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET ConventionalRoute/ActionWithStringParameter/{id?}", + "ActivityHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", "MetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -94,8 +94,8 @@ ```json { "IdealHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", - "ActivityDisplayName": "/ConventionalRoute/ActionWithStringParameter", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET ConventionalRoute/ActionWithStringParameter/{id?}", + "ActivityHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}", "MetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -127,7 +127,7 @@ ```json { "IdealHttpRoute": "", - "ActivityDisplayName": "/ConventionalRoute/NotFound", + "ActivityDisplayName": "GET", "ActivityHttpRoute": "", "MetricHttpRoute": "", "RouteInfo": { @@ -146,8 +146,8 @@ ```json { "IdealHttpRoute": "SomePath/{id}/{num:int}", - "ActivityDisplayName": "/SomePath/SomeString/2", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET SomePath/{id}/{num:int}", + "ActivityHttpRoute": "SomePath/{id}/{num:int}", "MetricHttpRoute": "SomePath/{id}/{num:int}", "RouteInfo": { "HttpMethod": "GET", @@ -181,7 +181,7 @@ ```json { "IdealHttpRoute": "", - "ActivityDisplayName": "/SomePath/SomeString/NotAnInt", + "ActivityDisplayName": "GET", "ActivityHttpRoute": "", "MetricHttpRoute": "", "RouteInfo": { @@ -200,8 +200,8 @@ ```json { "IdealHttpRoute": "{area:exists}/ControllerForMyArea/Default/{id?}", - "ActivityDisplayName": "/MyArea", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET {area:exists}/ControllerForMyArea/Default/{id?}", + "ActivityHttpRoute": "{area:exists}/ControllerForMyArea/Default/{id?}", "MetricHttpRoute": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -231,8 +231,8 @@ ```json { "IdealHttpRoute": "{area:exists}/ControllerForMyArea/NonDefault/{id?}", - "ActivityDisplayName": "/MyArea/ControllerForMyArea/NonDefault", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET {area:exists}/ControllerForMyArea/NonDefault/{id?}", + "ActivityHttpRoute": "{area:exists}/ControllerForMyArea/NonDefault/{id?}", "MetricHttpRoute": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -262,8 +262,8 @@ ```json { "IdealHttpRoute": "SomePrefix/AnotherArea/Index/{id?}", - "ActivityDisplayName": "/SomePrefix", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET SomePrefix/AnotherArea/Index/{id?}", + "ActivityHttpRoute": "SomePrefix/AnotherArea/Index/{id?}", "MetricHttpRoute": "SomePrefix/{controller=AnotherArea}/{action=Index}/{id?}", "RouteInfo": { "HttpMethod": "GET", @@ -293,7 +293,7 @@ ```json { "IdealHttpRoute": "AttributeRoute", - "ActivityDisplayName": "AttributeRoute", + "ActivityDisplayName": "GET AttributeRoute", "ActivityHttpRoute": "AttributeRoute", "MetricHttpRoute": "AttributeRoute", "RouteInfo": { @@ -323,7 +323,7 @@ ```json { "IdealHttpRoute": "AttributeRoute/Get", - "ActivityDisplayName": "AttributeRoute/Get", + "ActivityDisplayName": "GET AttributeRoute/Get", "ActivityHttpRoute": "AttributeRoute/Get", "MetricHttpRoute": "AttributeRoute/Get", "RouteInfo": { @@ -353,7 +353,7 @@ ```json { "IdealHttpRoute": "AttributeRoute/Get/{id}", - "ActivityDisplayName": "AttributeRoute/Get/{id}", + "ActivityDisplayName": "GET AttributeRoute/Get/{id}", "ActivityHttpRoute": "AttributeRoute/Get/{id}", "MetricHttpRoute": "AttributeRoute/Get/{id}", "RouteInfo": { @@ -386,7 +386,7 @@ ```json { "IdealHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "ActivityDisplayName": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", + "ActivityDisplayName": "GET AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "ActivityHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "MetricHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "RouteInfo": { @@ -419,7 +419,7 @@ ```json { "IdealHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "ActivityDisplayName": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", + "ActivityDisplayName": "GET AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "ActivityHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "MetricHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", "RouteInfo": { @@ -452,8 +452,8 @@ ```json { "IdealHttpRoute": "/Index", - "ActivityDisplayName": "/", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET /Index", + "ActivityHttpRoute": "/Index", "MetricHttpRoute": "", "RouteInfo": { "HttpMethod": "GET", @@ -481,8 +481,8 @@ ```json { "IdealHttpRoute": "/Index", - "ActivityDisplayName": "Index", - "ActivityHttpRoute": "Index", + "ActivityDisplayName": "GET /Index", + "ActivityHttpRoute": "/Index", "MetricHttpRoute": "Index", "RouteInfo": { "HttpMethod": "GET", @@ -510,8 +510,8 @@ ```json { "IdealHttpRoute": "/PageThatThrowsException", - "ActivityDisplayName": "PageThatThrowsException", - "ActivityHttpRoute": "PageThatThrowsException", + "ActivityDisplayName": "GET /PageThatThrowsException", + "ActivityHttpRoute": "/PageThatThrowsException", "MetricHttpRoute": "PageThatThrowsException", "RouteInfo": { "HttpMethod": "GET", @@ -539,7 +539,7 @@ ```json { "IdealHttpRoute": "", - "ActivityDisplayName": "/js/site.js", + "ActivityDisplayName": "GET", "ActivityHttpRoute": "", "MetricHttpRoute": "", "RouteInfo": { @@ -558,8 +558,8 @@ ```json { "IdealHttpRoute": "/MinimalApi", - "ActivityDisplayName": "/MinimalApi", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET /MinimalApi", + "ActivityHttpRoute": "/MinimalApi", "MetricHttpRoute": "/MinimalApi", "RouteInfo": { "HttpMethod": "GET", @@ -577,8 +577,8 @@ ```json { "IdealHttpRoute": "/MinimalApi/{id}", - "ActivityDisplayName": "/MinimalApi/123", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET /MinimalApi/{id}", + "ActivityHttpRoute": "/MinimalApi/{id}", "MetricHttpRoute": "/MinimalApi/{id}", "RouteInfo": { "HttpMethod": "GET", @@ -598,8 +598,8 @@ ```json { "IdealHttpRoute": "/MinimalApiUsingMapGroup/", - "ActivityDisplayName": "/MinimalApiUsingMapGroup", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET /MinimalApiUsingMapGroup/", + "ActivityHttpRoute": "/MinimalApiUsingMapGroup/", "MetricHttpRoute": "/MinimalApiUsingMapGroup/", "RouteInfo": { "HttpMethod": "GET", @@ -617,8 +617,8 @@ ```json { "IdealHttpRoute": "/MinimalApiUsingMapGroup/{id}", - "ActivityDisplayName": "/MinimalApiUsingMapGroup/123", - "ActivityHttpRoute": "", + "ActivityDisplayName": "GET /MinimalApiUsingMapGroup/{id}", + "ActivityHttpRoute": "/MinimalApiUsingMapGroup/{id}", "MetricHttpRoute": "/MinimalApiUsingMapGroup/{id}", "RouteInfo": { "HttpMethod": "GET", diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestCases.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestCases.cs index d2b7bb730df..1bfca89346c 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestCases.cs +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestCases.cs @@ -72,10 +72,6 @@ public class TestCase public string? ExpectedHttpRoute { get; set; } - public string? CurrentActivityDisplayName { get; set; } - - public string? CurrentActivityHttpRoute { get; set; } - public string? CurrentMetricHttpRoute { get; set; } public override string ToString() diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestCases.json b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestCases.json index c5c8febb77b..6c9bb3fba4b 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestCases.json +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestCases.json @@ -5,8 +5,6 @@ "httpMethod": "GET", "path": "/", "expectedStatusCode": 200, - "currentActivityDisplayName": "/", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", "expectedHttpRoute": "ConventionalRoute/Default/{id?}" }, @@ -16,8 +14,6 @@ "httpMethod": "GET", "path": "/ConventionalRoute/ActionWithStringParameter/2?num=3", "expectedStatusCode": 200, - "currentActivityDisplayName": "/ConventionalRoute/ActionWithStringParameter/2", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", "expectedHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}" }, @@ -27,8 +23,6 @@ "httpMethod": "GET", "path": "/ConventionalRoute/ActionWithStringParameter?num=3", "expectedStatusCode": 200, - "currentActivityDisplayName": "/ConventionalRoute/ActionWithStringParameter", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": "{controller=ConventionalRoute}/{action=Default}/{id?}", "expectedHttpRoute": "ConventionalRoute/ActionWithStringParameter/{id?}" }, @@ -38,8 +32,6 @@ "httpMethod": "GET", "path": "/ConventionalRoute/NotFound", "expectedStatusCode": 404, - "currentActivityDisplayName": "/ConventionalRoute/NotFound", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": "", "expectedHttpRoute": "" }, @@ -49,8 +41,6 @@ "httpMethod": "GET", "path": "/SomePath/SomeString/2", "expectedStatusCode": 200, - "currentActivityDisplayName": "/SomePath/SomeString/2", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": null, "expectedHttpRoute": "SomePath/{id}/{num:int}" }, @@ -60,8 +50,6 @@ "httpMethod": "GET", "path": "/SomePath/SomeString/NotAnInt", "expectedStatusCode": 404, - "currentActivityDisplayName": "/SomePath/SomeString/NotAnInt", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": null, "expectedHttpRoute": "" }, @@ -71,8 +59,6 @@ "httpMethod": "GET", "path": "/MyArea", "expectedStatusCode": 200, - "currentActivityDisplayName": "/MyArea", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", "expectedHttpRoute": "{area:exists}/ControllerForMyArea/Default/{id?}" }, @@ -82,8 +68,6 @@ "httpMethod": "GET", "path": "/MyArea/ControllerForMyArea/NonDefault", "expectedStatusCode": 200, - "currentActivityDisplayName": "/MyArea/ControllerForMyArea/NonDefault", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": "{area:exists}/{controller=ControllerForMyArea}/{action=Default}/{id?}", "expectedHttpRoute": "{area:exists}/ControllerForMyArea/NonDefault/{id?}" }, @@ -93,8 +77,6 @@ "httpMethod": "GET", "path": "/SomePrefix", "expectedStatusCode": 200, - "currentActivityDisplayName": "/SomePrefix", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": "SomePrefix/{controller=AnotherArea}/{action=Index}/{id?}", "expectedHttpRoute": "SomePrefix/AnotherArea/Index/{id?}" }, @@ -104,8 +86,6 @@ "httpMethod": "GET", "path": "/AttributeRoute", "expectedStatusCode": 200, - "currentActivityDisplayName": "AttributeRoute", - "currentActivityHttpRoute": null, "currentMetricHttpRoute": null, "expectedHttpRoute": "AttributeRoute" }, @@ -115,8 +95,6 @@ "httpMethod": "GET", "path": "/AttributeRoute/Get", "expectedStatusCode": 200, - "currentActivityDisplayName": "AttributeRoute/Get", - "currentActivityHttpRoute": null, "currentMetricHttpRoute": null, "expectedHttpRoute": "AttributeRoute/Get" }, @@ -126,8 +104,6 @@ "httpMethod": "GET", "path": "/AttributeRoute/Get/12", "expectedStatusCode": 200, - "currentActivityDisplayName": "AttributeRoute/Get/{id}", - "currentActivityHttpRoute": null, "currentMetricHttpRoute": null, "expectedHttpRoute": "AttributeRoute/Get/{id}" }, @@ -137,8 +113,6 @@ "httpMethod": "GET", "path": "/AttributeRoute/12/GetWithActionNameInDifferentSpotInTemplate", "expectedStatusCode": 200, - "currentActivityDisplayName": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "currentActivityHttpRoute": null, "currentMetricHttpRoute": null, "expectedHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate" }, @@ -148,8 +122,6 @@ "httpMethod": "GET", "path": "/AttributeRoute/NotAnInt/GetWithActionNameInDifferentSpotInTemplate", "expectedStatusCode": 400, - "currentActivityDisplayName": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate", - "currentActivityHttpRoute": null, "currentMetricHttpRoute": null, "expectedHttpRoute": "AttributeRoute/{id}/GetWithActionNameInDifferentSpotInTemplate" }, @@ -159,8 +131,6 @@ "httpMethod": "GET", "path": "/", "expectedStatusCode": 200, - "currentActivityDisplayName": "/", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": "", "expectedHttpRoute": "/Index" }, @@ -170,8 +140,6 @@ "httpMethod": "GET", "path": "/Index", "expectedStatusCode": 200, - "currentActivityDisplayName": "Index", - "currentActivityHttpRoute": "Index", "currentMetricHttpRoute": "Index", "expectedHttpRoute": "/Index" }, @@ -181,8 +149,6 @@ "httpMethod": "GET", "path": "/PageThatThrowsException", "expectedStatusCode": 500, - "currentActivityDisplayName": "PageThatThrowsException", - "currentActivityHttpRoute": "PageThatThrowsException", "currentMetricHttpRoute": "PageThatThrowsException", "expectedHttpRoute": "/PageThatThrowsException" }, @@ -192,8 +158,6 @@ "httpMethod": "GET", "path": "/js/site.js", "expectedStatusCode": 200, - "currentActivityDisplayName": "/js/site.js", - "currentActivityHttpRoute": null, "currentMetricHttpRoute": null, "expectedHttpRoute": "" }, @@ -203,8 +167,6 @@ "httpMethod": "GET", "path": "/MinimalApi", "expectedStatusCode": 200, - "currentActivityDisplayName": "/MinimalApi", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": null, "expectedHttpRoute": "/MinimalApi" }, @@ -214,8 +176,6 @@ "httpMethod": "GET", "path": "/MinimalApi/123", "expectedStatusCode": 200, - "currentActivityDisplayName": "/MinimalApi/123", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": null, "expectedHttpRoute": "/MinimalApi/{id}" }, @@ -226,8 +186,6 @@ "httpMethod": "GET", "path": "/MinimalApiUsingMapGroup", "expectedStatusCode": 200, - "currentActivityDisplayName": "/MinimalApiUsingMapGroup", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": null, "expectedHttpRoute": "/MinimalApiUsingMapGroup/" }, @@ -238,8 +196,6 @@ "httpMethod": "GET", "path": "/MinimalApiUsingMapGroup/123", "expectedStatusCode": 200, - "currentActivityDisplayName": "/MinimalApiUsingMapGroup/123", - "currentActivityHttpRoute": "", "currentMetricHttpRoute": null, "expectedHttpRoute": "/MinimalApiUsingMapGroup/{id}" } diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestFixture.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestFixture.cs index 1addda01cb6..ab3ac187b0c 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestFixture.cs +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestFixture.cs @@ -77,15 +77,14 @@ private void GenerateReadme() var sb = new StringBuilder(); sb.AppendLine($"# Test results for ASP.NET Core {Environment.Version.Major}"); sb.AppendLine(); - sb.AppendLine("| Span http.route | Metric http.route | App | Test Name |"); - sb.AppendLine("| - | - | - | - |"); + sb.AppendLine("| Metric http.route | App | Test Name |"); + sb.AppendLine("| - | - | - |"); for (var i = 0; i < this.testResults.Count; ++i) { var result = this.testResults[i]; - var emoji1 = result.TestCase.CurrentActivityHttpRoute == null ? ":green_heart:" : ":broken_heart:"; - var emoji2 = result.TestCase.CurrentMetricHttpRoute == null ? ":green_heart:" : ":broken_heart:"; - sb.Append($"| {emoji1} | {emoji2} "); + var emoji1 = result.TestCase.CurrentMetricHttpRoute == null ? ":green_heart:" : ":broken_heart:"; + sb.Append($"| {emoji1} "); sb.AppendLine($"| {result.TestCase.TestApplicationScenario} | [{result.TestCase.Name}]({MakeAnchorTag(result.TestCase.TestApplicationScenario, result.TestCase.Name)}) |"); } diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTests.cs index d8983db9d4d..607d1e52d1b 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTests.cs +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTests.cs @@ -99,35 +99,19 @@ public async Task TestHttpRoute(RoutingTestCases.TestCase testCase, bool useLega Assert.Equal(testCase.HttpMethod, activityHttpMethod); Assert.Equal(testCase.HttpMethod, metricHttpMethod); - // TODO: The CurrentActivityDisplayName, CurrentActivityHttpRoute, and CurrentMetricHttpRoute - // properties will go away. They only serve to capture status quo. The "else" blocks are the real - // asserts that we ultimately want. - // If any of the current properties are null, then that means we already conform to the + // Activity.DisplayName should be a combination of http.method + http.route attributes, see: + // https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md#name + var expectedActivityDisplayName = string.IsNullOrEmpty(testCase.ExpectedHttpRoute) + ? testCase.HttpMethod + : $"{testCase.HttpMethod} {testCase.ExpectedHttpRoute}"; + + Assert.Equal(expectedActivityDisplayName, activity.DisplayName); + Assert.Equal(testCase.ExpectedHttpRoute, activityHttpRoute); + + // TODO: The CurrentMetricHttpRoute property will go away. It only serves to capture status quo. + // The else block asserts what we ultimately want. + // When CurrentMetricHttpRoute is null, that means we already conform to the // correct behavior. - if (testCase.CurrentActivityDisplayName != null) - { - Assert.Equal(testCase.CurrentActivityDisplayName, activity.DisplayName); - } - else - { - // Activity.DisplayName should be a combination of http.method + http.route attributes, see: - // https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md#name - var expectedActivityDisplayName = string.IsNullOrEmpty(testCase.ExpectedHttpRoute) - ? testCase.HttpMethod - : $"{testCase.HttpMethod} {testCase.ExpectedHttpRoute}"; - - Assert.Equal(expectedActivityDisplayName, activity.DisplayName); - } - - if (testCase.CurrentActivityHttpRoute != null) - { - Assert.Equal(testCase.CurrentActivityHttpRoute, activityHttpRoute); - } - else - { - Assert.Equal(testCase.ExpectedHttpRoute, activityHttpRoute); - } - if (testCase.CurrentMetricHttpRoute != null) { Assert.Equal(testCase.CurrentMetricHttpRoute, metricHttpRoute);