Clarify routes may contain static and dynamic segments#2734
Clarify routes may contain static and dynamic segments#2734joaopgrassi merged 12 commits intoopen-telemetry:mainfrom
Conversation
lmolkova
left a comment
There was a problem hiding this comment.
Thanks!
I like the clarifications and examples of how routes look like in different frameworks, but I still don't get why we'd change stable instrumentation behavior and change routing info provided by the framework.
Because customers don't like how there is no cardinality (only 1 grouping) in asp.net which is |
I'm with you - what I don't get is where do we produce absolutely useless |
I'm not sure I follow 100%. (See more faulting spans at #2616 (comment)) produces: |
|
what's the problem with |
No, in terms of ASP.NET it's the syntax to say which controller and action is default if you hit the root. (see See this example (there is no {id} even, because ? allows it to miss): |
|
More about ASP.NET route tests here, you can see it's not simple, there are different methods and outcomes: |
|
I think I was able to repro. So the problem statement as I understand this:
More on p1: let's say I create ...
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}")
.WithStaticAssets();
...
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger) { _logger = logger; }
public IActionResult Index() { return View(); }
public IActionResult Privacy()
{
_logger.LogInformation("Privacy page requested, RoutePattern {}, routedata: controller {}, action {}",
(HttpContext.GetEndpoint() as RouteEndpoint)?.RoutePattern.RawText,
RouteData.Values.GetValueOrDefault("controller"),
RouteData.Values.GetValueOrDefault("action"));
return View();
}
}What I see in the log is OTel instrumentation uses To me it sounds like we need to figure out what the right behavior for ASP.NET Core instrumentation is - do we know it already? |
My answer would be general standardization to offer unified experience. Why this little string even matters that much, is because of the overall metrics of The other option is to detach span name from http.route and leave http.route as is provided by the framework. |
|
@RassK could you folks please create an issue for ASP.NET Core instrumentation, suggest the fix that would make span names AND routes useful for ASP.NET Core and once you have consensus, we'd make sure semconv can accomodate it? update: it's within ASP.NET Core instrumentation freedom on what to put into http.route. What it puts today does not seem to work well with MVC - let's fix it. |
|
@matt-hensley I think you need to re-generate markdown from yaml to make checks pass, could you please also undraft the PR? it looks great otherwise |
Saw those checks fail, resolving some issues with my Windows env and the docs tooling |
Co-authored-by: Trask Stalnaker <[email protected]>
Co-authored-by: Trask Stalnaker <[email protected]>
Signed-off-by: Joao Grassi <[email protected]>
Fixes #2616
Changes
Alternative proposal to #2717 with additional language to explain intent behind "static" and "dynamic" route segments and how their value should be handled.
Merge requirement checklist
[chore]