This topic provides some guidance and examples of the correct syntax for using getter chains in AppDynamics configurations.
Using Getter Chains
You can use getter chains to:
- Configure method invocation data collectors. See Configure Data Collectors.
- Define a new business transaction custom match rule that uses a POCO object instance as the mechanism to name the transaction. See POCO Entry Points.
Note: If a getter chain calls on a method that does a lot of processing, such as making numerous SQL calls, it can degrade the performance of the application and the App Agent for .NET. Ideally, use getter chains only with simple gets.
An example of a simple getter would be a method to return a property from a class, such as GetName().
Separators in Getter Chains
The following special characters are used as separators:
- comma (,) for separating parameters
- forward slash (/) for separating a type declaration from a value in a parameter
- dot (.) for separating the methods and properties in the getter chain
If a slash or a comma character is used in a string parameter, use the backslash (\) escape character. Except in the case of type / value.
If a literal dot is used in a string parameter, use the backslash escape character before the dot.
Getter Chain Examples
These examples are intended to get you started with the getter chain syntax for AppDynamics.
Getter chain with integer parameters in the substring method using the forward slash as the type separator:
This example returns the first 10 characters of a string. The int parameter types resolve which overloaded method to call.
Getter chain with various non-string parameter types:
For cases when you specify
type / char, you don't need to escape anything after the type.
Getter chain with forward slash escaped; escape character needed here for the string parameter:
This example splits a URL on the forward slash character and returns a string array. The following examples are more likely.
Getter chain with an array element:
Getter chain with multiple array elements separated by commas:
Getter chain retrieves property values, such as the length of an array:
Getter chain using backslash to escape the dot in the string parameter;
the call is getParam (a.b.c).
In the following getter chain, the first dot requires an escape character because it is in a string method parameter (inside the parentheses). The second dot does not require an escape character because it is not in a method parameter (it is outside the parentheses).
- The following getter chain is from a transaction splitting rule on URIs that use a semicolon as a delimiter; for example:
The getter chain splits on the API name, so the resulting split transactions are "API.abc", API."xyz" and so on.
The call gets the URI using GetUri() and then splits it using the escaped forward slash. From the resulting array it takes the third entry (as the split treats the first slash as a separator) and inserts what before the slash (in this case, nothing) into the first entry. Then it splits this result using the semicolon, getting the first entry of the resulting array, which in this case contains the API name.