On this page:

Related pages:

Getter chains let you access method data in various contexts of the AppDynamics configuration. For example, getter chains enable you to name business transactions based on return values.

This topic describes how to use getter chains.

About Getter Chains

You can use getter chains to:

As a best practice, you should use getter chains with simple getter methods only. Getter chains on processing-intensive methods, such as one that make numerous SQL calls, can result in degraded performance for the application and agent. 

For example, the following shows a simple get method that returns a property for a class, such as MyUser.Name:

public class MyUser
{
   private String Name {get; set;}
   private String Url;
   public GetUrl() {
      return this.Url;
   }
}

Special Characters in Getter Chains

Use the following special characters as indicated:

Getter chains also treat spaces at the beginning or end of a string as special characters.

Escape Literal Characters

If the getter chain should treat a special character literally, escape it using a backslash. For parentheses, you only need to escape the closing parenthesis in a string.

.NET Notes and Examples

The following sections apply to getter chains used in .NET Agent configurations.

Declare Parameter Types

The .NET Agent identifies parameter types as follows:

Therefore 0 means string/0 if you have a hash, or anything that translates to get_Item (any kind of property). 0 means int/0 if you have an array.

When your getter chain uses a method with parameters other than the default type, you need to declare the parameter type.

Access Indexed Properties and Dictionary Values

If your getter chain accesses a dictionary object, you can access the values using the following syntax:

Split by Character or Regular Expression Match in .NET Getter Chains

You can split values matched by character or as a string by matching a regular expression pattern. The result of a split operation is a string or character array that you can reference in your getter chain by array index value. 

The following examples illustrate how to use the character and string regular expression split operations in getter chains.

Split by Character

Split by Regular Expression

For more control, you can split values by string-based pattern matching. Pattern matching is particularly useful for situations that require complex matching, such as matching content within a request body. 

The following example shows a getter chain that splits the value returned by GetAddress() and selects the seventh element in the resultant array: 

GetAddress().Split(string/\W+).[6]

Given an address such as "303 2nd St, San Francisco, CA 94107", the example splits the value by word and references the sixth word in the array, "CA" in this case. 

Compose Getter Chains for HTTP Requests

The .NET Agent requires special syntax for getter chains for HTTP Requests.

For ASP.NET WebForms, MVC, and MVC WebAPI applications, create getter chains based upon the System.Web.HttpRequest objects.

For ASP.NET Core on the full framework, create getter chains based upon Microsoft.AspNetCore.Http.Internal.DefaultHttpRequest objects.

If you have both ASP.NET and ASP.NET Core on the full framework apps in the same tier, you cannot use a getter chain to apply to both because the two frameworks use different objects to handle HTTP requests.


For ASP.NET Core on the full framework, you need to use the <TBD> object

Places to use this syntax include:

Java Notes and Examples

The following sections apply to getter chains used in Java Agent configurations.

Values Passed in a Getter Chain

The value passed in a getter chain is always a string unless cast to another type.  

The following cast types are supported:

The following section shows examples of how to refer to the types in parameters to getter chain methods. Notice that letter case is not important for the names of the types. Type casing is performed in a case-insensitive manner.

Java Getter Chain Examples