Custom Instrumentation


APM Insight agent instruments predefined classes of several Web Components and Frameworks to provide insight into the application. APM Insight also provides an option to custom instrument, classes of your choice. Custom instrumentation helps in providing wider insight into applications, where it will be easier to track performance of specific features or modules in the application.

Java Agent provides two ways to custom instrument your application:

  • Using Configuration file - You can use this method when you want to instrument classes or methods for specific instances. 
  • Using Java Annotations - Use annotations to extract additional values by making changes in your application. Changes are reflected across all your application instances.
  • Using Web Client - You can instrument your application methods and classes from Applications Manager web client. Changes are reflected across all your application instances.

Using Configuration File

  1. To instrument classes of your choice, specify the class name in 'custom_instrumentation.conf' (for versions below 4.9) or 'instrumentation.conf' (for versions 4.9 and above) file, as per format specified below:

    Fully qualified ClassName : methodNames separated by comma(,) : component_Name

  2. Each entry of class/package must added in a new line.

  3. Use comma(,) as method separator for multiple entries.

  4. If methods to be instrumented is left blank, all methods under the specified class will be instrumented. If there exists, overloading methods that needs to be instrumented, all the overloaded methods will be instrumented. 

  5. Only a-zA-Z_0-9 characters are allowed for naming a component. If component_Name is not specified or invalid, by default agent considers it as APP Code.

    Example:

    a/b/c/CustomClass : methodA, methodB : ComponentA
    a/b/c/CustomClass : methodC : ComponentB
    a/b/c/CustomClass : : Component_A1
    a/b/c/CustomClass : :

  6. If all classes in a package needs to be instrumented, specify the package name as described below.

    package_name/.* :

    Example:

    a/b/c/.* : : Component_C
    a/b/c/d/.* : :

  7. It is not recommended to specify packages as input, as the agent will instrument all methods in all classes and all packages under it. These may cost extra overhead in CPU and memory usage. Also, there will be many methods that are of least interest and also these makes the traces lengthy. Although it can be used to study the code flow.
Note: It requires a application server restart for the changes to be effective