IBM Tivoli Composite Application Manager for Application Diagnostics, Version 7.1.0.1

Define custom requests

A custom request is an application class and method that you designate as an edge or nested request. When the method runs, a start and end request trace record is written to the Level 1 or Level 2 tracing.
Custom requests are defined in the DC_home/itcamdc/etc/custom_requests.xml file. The product-supplied version of this file is only a sample and must be customized by the user. In addition, this feature is enabled by making an adjustment in the custom_directory/toolkit_custom.properties file.

Perform the following procedure to enable and define tracing of custom requests:

  1. Make a copy of the custom_requests.xml file, and open it up in a text editor.

  2. Modify the parameters in the custom_requests.xml file. The following table describes the parameters you can modify:


    Parameters for Custom Requests Configuration File

    Tag Name Description
    edgeRequest One or more application methods that are to be Byte-Code-Instrumented for custom request processing. By modifying the requestName, Matches, type, and methodName tags within the edgeRequest tag, you can customize the selection. Each edgeRequest tag must contain exactly one methodName tag, and one or more Matches tags. Multiple edgeRequest tags can be specified.
    requestName Unique name for this request. The request name is displayed in the L1 or L2 trace entry that is produced when one of the methods identified by this custom request runs.
    Matches Class or classes containing methods to be Byte-Code-Instrumented for custom request processing. Multiple Matches tags can be present within a single edgeRequest tag.
    type Indicates whether or not a class must be a system or application class in order to match the edgeRequest tag.
    methodName Identifies the names of the methods within one of the classes identified by the Matches tag that are to be Byte-Code-Instrumented for custom request processing. Exactly one methodName tag can be specified in each edgeRequest tag.

    The Matches and the methodName tags can include wildcard characters. The following section describes how the wildcard characters work:

    • Asterisk (*) stands for zero or more occurrences of any character when used by itself. When embedded within a sequence of characters (for example, java.*.String), it matches zero or more occurrences of any character except the package separator (.).

    • Two periods (..) can be used to specify all sub-packages (for example, java..String matches java.lang.String). It matches any sequence of characters that starts and ends with the package separator (.).

    For example, an application with a package name of com.mycompany.myapp has the following requirements:

    • Within the Customer class, the creditCheck() method should be treated as a custom request called CreditCheck.

    • Within the Supplier class, the inventoryCheck() method should be treated as a custom request called SupplyCheck.

    The following example shows the contents of the customized custom_requests.xml file that accomplishes this:

        <customEdgeRequests>
              <edgeRequest>
                      <requestName>CreditCheck</requestName>
                      <Matches>com.mycompany.myapp.Customer</Matches>
                      <type>application</type>
                      <methodName>creditCheck</methodName>
              </edgeRequest>
              <edgeRequest>
                      <requestName>SupplyCheck</requestName>
                      <Matches>com.mycompany.myapp.Supplier</Matches>
                      <type>application</type>
                      <methodName>inventoryCheck</methodName>
              </edgeRequest>
        </customEdgeRequests>   

  3. Complete one of the following steps:

    • Save the file as DC_home/itcamdc/etc/custom_requests.xml, then complete the following steps:

      1. In the custom_directory/toolkit_custom.properties file, uncomment the following line by removing the number sign (#) at the beginning of the line:
        #am.camtoolkit.gpe.customxml.custom=DC_home/itcamdc/etc/
        custom_requests.xml

      2. Change this line by replacing the path with just the file name of the file you modified in Step 2.

    • Save the file in any directory on your server, then complete the following steps:

      1. In the custom_directory/toolkit_custom.properties file, uncomment the following line by removing the number sign (#) at the beginning of the line:
        #am.camtoolkit.gpe.customxml.custom=DC_home/itcamdc/etc/
        custom_requests.xml

      2. Change this line by specifying the path and name for the file you modified in Step 2.


Parent topic:

Customization and advanced configuration for the data collector