PDFs

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

Info

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.

  • Use the following syntax to delineate the boundaries of the getter chain:

    No Format
    ${myobject.myproperty}
  • The following example determines the user principal:

    No Format
    ${Context.User.Identity.Name}

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

Places to use this syntax include:

  • HTTP Request Data Collectors
  • ASP.NET Transaction Detection custom expressions

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:

  • int
  • float
  • bool (the primitive Boolean value)
  • boolean (a boxed boolean value; i.e. an object type that wraps a boolean)
  • long
  • object

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

  • Getter chain with integer parameters in the substring method using the forward slash as the type separator:

    No Format
    getAddress(appdynamics, sf).substring(int/0, int/10)
  • Getter chain with various non-string parameter types:

    No Format
    getAddress(appdynamics, sf).myMethod(float/0.2, boolean/true, boolean/false, int/5)
  • Getter chain with forward slash escaped; escape character needed here for the string parameter:

    No Format
    getUrl().split(\/) # node slash is escaped by a backward slash
  • Getter chain with an array element:

    No Format
    getUrl().split(\/).[4]
  • Getter chains that return Hashmap values:

    No Format
    get(object/myvalue).substring(int/0,int/10) 
    get(object/ACTION)
  • Getter chain with multiple array elements separated by commas:

    No Format
    getUrl().split(\/).[1,3]
  • Getter chain retrieves property values, such as the length of an array:

    No Format
    getUrl().split(\.).length
  • Getter chain using backslash to escape the dot in the string parameter;
    the call is getParam (a.b.c).

    No Format
    getAddress.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).

    No Format
    getName(suze\.smith)getClass().getSimpleName()
  • The following getter chain is from a transaction splitting rule on URIs that use a semicolon as a delimiter.

    No Format
    getRequestURI().split(\/).[2].split(;).[0]

    The call gets the URI using getRequestURI() 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. 
    For example, given the following URI:

    No Format
    /my-webapp/xyz;jsessionid=BE7F31CC0235C796BF8C6DF3766A1D00?act=Add&uid=c42ab7ad-48a7-4353-bb11-0dfeabb798b5


    The getter chain splits on the API name, so the resulting split transactions are "API.abc", "API.xyz" and so on.

    Tip: When using string.split(), remember that it takes a regex and you have to escape any special regex characters.

    For example, if you want to split on left square bracket ([):

    No Format
    Java syntax: split("
    [")
    Getter chain syntax: split([)