Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASP.NET - create transaction name based on route and group by optional values #201

Closed
SergeyKleyman opened this issue Apr 25, 2019 · 2 comments · Fixed by #973
Closed

ASP.NET - create transaction name based on route and group by optional values #201

SergeyKleyman opened this issue Apr 25, 2019 · 2 comments · Fixed by #973

Comments

@SergeyKleyman
Copy link
Contributor

SergeyKleyman commented Apr 25, 2019

The same as #84 but for Full Framework ASP.NET.

We will probably be able to do it automatically for ASP.NET frameworks that have routing such as MVC and WebApi. In addition we might also consider supporting manual configuration similar to the one implemented by Java agent - https://www.elastic.co/guide/en/apm/agent/java/current/config-http.html#config-url-groups

@gregkalapos
Copy link
Contributor

We could use HttpApplication.Context.Request.RequestContext.RouteData in case it's an MVC model. If it's WebForms, I think it's reasonable to just use the .aspx page name.

@gregkalapos
Copy link
Contributor

A bit more info here:

  • Currently on ASP.NET Classic we generate transaction name purely on the url, so we create transactions with names like /user/1, /user/2, etc.
  • On ASP.NET Core we do it according to the spec, so above 2 urls would be both called /user/{userId}/.
  • This behavior leads to transaction group explosion and it gets more important because for some server features it's really important to group those parametrized calls together
  • The same logic for ASP.NET Core is here. We'd need that for ASP.NET Classic somewhere around here

russcam added a commit to russcam/apm-agent-dotnet that referenced this issue Oct 12, 2020
This commit normalizes the transaction name for ASP.NET MVC
Full Framework to use the convention of

<HTTP method> <area>/<controller>/<action> [<param>*]

which aligns with the convention used in ASP.NET Core
transaction names. The transaction name is determined from
the RouteData values, and where values are present but the
response is a 404, unknown route is used.

Integration tests introduce an MVC area with a HomeController
and Index action, to assert that the area route datatoken is
taken into account. Without taking into account the area,
same named controller actions in areas would end up
aggregrated under the same transaction name.

Closes elastic#201
@russcam russcam self-assigned this Oct 12, 2020
russcam added a commit to russcam/apm-agent-dotnet that referenced this issue Oct 21, 2020
This commit normalizes the transaction name for ASP.NET MVC
Full Framework to use the convention of

<HTTP method> <area>/<controller>/<action> [<param>*]

which aligns with the convention used in ASP.NET Core
transaction names. The transaction name is determined from
the RouteData values, and where values are present but the
response is a 404, unknown route is used.

Integration tests introduce an MVC area with a HomeController
and Index action, to assert that the area route datatoken is
taken into account. Without taking into account the area,
same named controller actions in areas would end up
aggregrated under the same transaction name.

Closes elastic#201
russcam added a commit that referenced this issue Oct 28, 2020
This commit normalizes the transaction name for ASP.NET MVC
Full Framework to use the convention of

<HTTP method> <area>/<controller>/<action> [<param>*]

which aligns with the convention used in ASP.NET Core
transaction names. The transaction name is determined from
the RouteData values.

- set unknown route only when the route data did not end up routing 
to a controller action. This is determined by looking for a 404 
HttpException coming from System.Web.Mvc.

- Add webforms page, routed webforms page, web api controller,
and area controller, to assert transaction name in each case.

- Integration tests introduce an MVC area with a HomeController
and Index action, to assert that the area route datatoken is
taken into account. Without taking into account the area,
same named controller actions in areas would end up
aggregrated under the same transaction name.

Closes #201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants