This topic describes how to enable asynchronous exit point detection in the App Agent for .NET. It covers the .NET asynchronous programming patterns the agent detects and provides instruction on how to use AppDynamics Controller features that represent asynchronous transactions.
Asynchronous Transactions in .NET
Developers use asynchronous programming patterns to create scalable, more performant applications. Microsoft .NET lets you designate methods as asynchronous tasks. The .NET runtime releases resources for asynchronous methods while tasks complete. When task processing finishes, the runtime calls back to the originating asynchronous method so the method may continue processing.
Because tasks may execute in parallel, AppDynamics sometimes represents asynchronous activity differently from synchronous activity in the Controller.
Supported asynchronous programming patterns
The agent discovers the following asynchronous programming patterns for HTTP, Web Service, and WCF exit points:
Microsoft .NET 4.5 async and await keywords. See Asynchronous Programming with Async and Await.
Not limited to exit point discovery:
Microsoft .NET 4.5 TaskFactory.FromAsync wrapper. See TPL and Traditional .NET Framework Asynchronous Programming.
If the entry point on a downstream WCF tier is asynchronous, the agent doesn't detect the transaction on the downstream tier.
To enable asynchronous exit point detection
To enable asynchronous exit point detection, register the async-tracking node property.
For instructions on how to set a node property, see App Agent Node Properties.
Description: Enable detection of asynchronous exit points. New in 3.8.5, enable thread correlation for ThreadPoolQueueUserWorkItem.
The default value is False.
Identify Asynchronous Transactions in Dashboards
When AppDynamics detects asynchronous exit points in an application it labels the calls as async in the dashboards. Because they may execute simultaneously the Controller doesn't display percentage value of the end-to-end transaction time for asynchronous calls.
For example, consider a travel site application that asynchronously searches fares on multiple provider sites and displays them back to the customer. In this case, the agent discovers the asynchronous HTTP calls and displays them on the transaction flow map.
For further visibility of asynchronous calls, edit the current flow map and click Use dotted line under Asynchronous Activity.
Use the transaction flow tree view of the asynchronous transaction to display errors and time spent in asynchronous tasks.
Troubleshoot Asynchronous Calls in Transaction Snapshots
Transaction snapshots include several features to help you discover problem areas in business transactions that use asynchronous methods. For an overview of transaction snapshots, see Transaction Snapshots.
Transaction Snapshot Flow Map
The Transaction Snapshot Flow Map graphically represents the business transaction. It displays the user experience, execution time, and timestamp of the transaction. The flow map also provides details of the overall time that is spent in a particular tier and in database and remote service calls. The async label indicates asynchronous calls.
Snapshot Execution Waterfall View
The transaction Snapshot Execution Waterfall View shows a timeline representation of the end-to-end execution of the business transaction. Synchronous and asynchronous processes appear on a bar diagram illustrating their relative execution time arranged in chronological order.
The waterfall view enables you to visually identify which processes are running the longest. Double-click a bar to drill down to a call graph and investigate problematic code.
When the agent detects asynchronous exit points, it displays an await link in the Exit Calls/Threads column of the call graph in the Call Drill Down. Click the link to display a list of the asynchronous calls. The format of the await link is as follows:
For example, the Travel Search Web tier makes asynchronous calls to the internal customer management system and to provider backends. The link shows as "await@Travel Search Web".
The Exit Calls and Async Activities window shows a list of the exit calls and the corresponding await continuation calls.
- Exit calls display by type: HTTP, web service, or WCF.
- Continuations/call backs display as
HTTP call to the Customer Management tier
Continuation call back to the Travel Search tier
Analyze Asynchronous Activity in the Metric Browser
The Metric Browser displays asynchronous activity in the following places:
- Business Transaction Performance -> Business Transactions -> tier > business transaction -> Thread Tasks -> Asynchronous Operation -> External Calls
- Overall Application Performance -> tier -> Thread Tasks -> Asynchronous Operation -> External Calls
- Overall Application Performance -> tier -> Individual Nodes -> node name -> Thread Tasks -> Asynchronous Operation -> External Calls
For more information on how to use the Metric Browser, see Metric Browser.