Skip to end of metadata
Go to start of metadata

You can configure the agent to identify transactions by MVC Controller/Action instead of the default naming by URI. For general information on organizing and naming business transactions, see Organizing Traffic as Business Transactions.

Identifying MVC Transactions by Controller and Action

By default the App Agent for .NET (agent) identifies ASP.NET MVC business transactions by the request URL or server URI.

In cases where an application accepts numerous client URLs for a single MVC controller and action, naming business transactions with the client URL can cause several issues including the following:

For example, consider a MVC application that lists store locations. City-specific URLs list the locations for a city:

http://myapp.mycompany.com/Bellevue

The business transaction name for this URL defaults to /Bellevue. Each request for a unique city generates a business transactions. None of the URIs contain common elements that you can use to configure business transaction names.

In the web application, all city location searches, such as /Bellevue, map to the Results action of the Search controller. After you configure the agent to name transactions by controller and action, the agent identifies the business transaction as Search/Results.

The Search/Results business transaction combines search requests for all cities into one transaction.

To identify ASP.NET MVC transactions by Controller/Action

To configure the agent to identify MVC transactions as Controller/Action, register the aspdotnet-mvc-naming-controlleraction node property. The node property works for MVC 3, MVC 4 and WebAPI transactions.

For instructions on how to set a node property, see App Agent Node Properties.

Name: aspdotnet-mvc-naming-controlleraction
Description: Identfy ASP.NET MVC Business Transactions as Controller/Action.
Type: Boolean
Value: True

(info) The default value is False.

After the agent registers traffic with a business transaction named for the Controller/Action and after traffic to the old business transactions named for the client URL diminishes, delete the old business transactions.

Business Transaction Naming Convention

New in 3.8.4, if you use Areas to organize your MVC application, the agent includes the Area name in the business transaction name:

/Area name/Controller name/Action name

For example, if your travel application has separate Areas for hotel, airfare, and car rentals:

/Hotel/Search/Results

Otherwise the agent names the transaction as follows:

/Controller name/Action name

Learn More

Business Transaction Limit
All Other Traffic Business Transaction
App Agent Node Properties
Configure Business Transaction Detection
ASP.NET Routing