Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
on 06-20-2018 07:42 AM - edited on 09-28-2018 04:58 PM by Nina.Wolinsky
Updated 9/28/18
The following article is intended for users who wish to implement custom correlation between .NET applications/tiers using the AppDynamics' .NET App Agent version 3.8 and higher.
You can also implement custom correlation using the AppDynamics' .NET Core Microservices Agent version 4.5.2 and higher by following slightly different steps.
For information regarding the Java Agent, see here: Custom Correlation for Java Applications
Custom correlation enables the user to configure AppDynamics to correlate transactions across tiers, or across parent-child threads in complex multithreaded applications when the default detection mechanisms are not capable of auto-correlating.
Correlation establishes the relationship between exit points on upstream tiers to entry points on downstream tiers. For transaction correlation to work, you must install the .NET Agent on both tiers.
To correlate a distributed invocation, the AppDynamics agent must propagate a unique correlation key by using the extension points of the distributed protocol or by decorating the payload.
The AppDynamics agent needs to know what methods to measure. When defining a custom correlation consider:
Use custom correlation when monitoring applications that use unsupported frameworks and protocols.
Use custom correlation XML configuration for business transaction correlation across tiers when the following conditions exist:
In custom correlation, the producer refers to the originating tier that makes the exit call. The consumer refers to the downstream tier that is the destination for the producer's exit call. If the .NET Agent automatically discovers the exit point for the transaction on the producer, you don't have to manually configure a producer. If it discovers the entry point on the consumer, you don't have to manually configure a consumer.
For custom correlation on communication protocols between nodes such as HTTP and JMS:
For custom correlation within a node:
To implement custom correlation, use XML configuration to specify how to instrument the application. The primary factors governing the exact configuration are the data structures and the sequence of code execution. Use the attached sample XML configuration as a starting point.
NOTE: For AppDynamics version 3.8, the correlation element does not inherit instrumentation element configuration from parent producer or consumer elements. Configure a different method in the correlation Instrumentation element for correlation to work. In most cases, the producer and consumer reside on separate machines, so they would have separate configuration files. The attached sample file demonstrates two standalone applications on the same machine: Producer.exe and Consumer.exe.
Before you begin: Install and configure the .NET Agent on both the producer and the consumer. If the producer is a Windows service or standalone application that does not implement any of the frameworks we instrument by default, configure a POCO entry point for a class/method in your service for the agent to begin instrumentation.
Before you configure custom correlation, you must identify the methods to instrument on both the producer and the consumer.
On the producer identify the following:
On the consumer:
Currently, for the .NET Agent, the instrumentation method (exit or entry point) and the payload methods must be different methods.
Configure the agent properties in the config.xml file in the agent config directory. See .NET Agent Directory Structure. All custom correlation configurations go inside the activities element, a child of the App Agents element. See .NET Agent Configuration Properties.
The following is a sample activities element with a producer element:
<activities>
<producer>
<!-- Configure the exit point. -->
<instrumentation>
<
class
-name>Producer.IdentifyTransaction</
class
-name>
<method-name>Test</method-name>
<match-type>MATCHES_CLASS</match-type>
<param-types>Producer.IdentifyTransaction</param-types>
</instrumentation>
<identifiers>
<identifier name=
"IdentifyTransactionTest"
>
<data-gatherer-type>INVOKED</data-gatherer-type>
<getter-chain>
this
</getter-chain>
<user-defined-name>IdentifyTransactionTest</user-defined-name>
<transformer-type>USER_DEFINED_NAME</transformer-type>
</identifier>
</identifiers>
<correlation>
<!-- Configure the payload method. -->
<instrumentation>
<
class
-name>Producer.IdentifyTransaction</
class
-name>
<method-name>TestCorrelation</method-name>
<match-type>MATCHES_CLASS</match-type>
<param-types>Producer.IdentifyTransaction</param-types>
</instrumentation>
<payload-pointer>
<data-gatherer-type>POSITION</data-gatherer-type>
<position>
0
</position>
<getter-chain>
this
</getter-chain>
<transformer-type>GETTER_METHODS</transformer-type>
</payload-pointer>
<payload-operation>
<access-type>method</access-type>
<access-method>setCorrelationKey</access-method>
<param-types>String</param-types>
</payload-operation>
</correlation>
</producer>
</activities>
Configure the agent properties in the config.xml file in the agent config directory. See .NET Agent Directory Structure. All custom correlation configurations go inside the activites element, a child of the App Agents element. See .NET Agent Configuration Properties.
The following is a sample activities element with a consumer element:
<activities>
<consumer identify-transaction=
"true"
>
<!-- Configure the entry point. -->
<instrumentation>
<
class
-name>Consumer.IdentifyTransaction</
class
-name>
<method-name>Test</method-name>
<match-type>MATCHES_CLASS</match-type>
</instrumentation>
<correlation>
<!-- Configure the payload method. -->
<instrumentation>
<
class
-name>Consumer.IdentifyTransaction</
class
-name>
<method-name>TestCorrelation</method-name>
<match-type>MATCHES_CLASS</match-type>
</instrumentation>
<payload-pointer>
<data-gatherer-type>POSITION</data-gatherer-type>
<position>
0
</position>
<getter-chain>
this
</getter-chain>
<transformer-type>GETTER_METHODS</transformer-type>
</payload-pointer>
<payload-operation>
<access-type>method</access-type>
<access-method>getCorrelationKey</access-method>
</payload-operation>
</correlation>
</consumer>
</activities>
You can implement custom correlation configuration for the .NET Core Microservices Agent in much of the same way as instructed above. The difference is that the location of the XML configuration goes into the AppDynamicsConfig.json file and not the config.xml file.
{ "controller": { ... }, "application": { ... }, "instrumentors": { "customCorrelationConfig": "custom-correlation.xml", "enable": [ ... ], "disable": [ ... ] }, .... }See AppDynamicsConfig.json File for a sample .json file.
Populate the custom correlation configuration file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <activities> <consumer identify-transaction="true"> <instrumentation> <class-name>Application.Program</class-name> <method-name>Method</method-name> <match-type>MATCHES_CLASS</match-type> </instrumentation> <correlation> .... </correlation> </consumer> </activities>
After you complete the configuration on the producer and consumer, you must restart the AppDynamics.Agent.Coordinator
service and instrumented applications.
Published on 6/5/2015.
Updated for 4.5.2 on 9/28/2018.
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form