Help APM APM for Java Custom Instrumentation

Custom Instrumentation

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 provide 3 ways to custom instrument your application

  • Using Web Client - You can instrument your application methods and classes from Site24x7 web client. Changes are reflected across all your application 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 Configuration file - You can use this method when you want to instrument classes or methods for specific instances. 

Configuration Steps

  1. Create a new file named instrumentation.conf in the same folder where apminsight.conf exists. 
  2. Add the classes/packages, as per the syntax provided below
    Fully qualified ClassName : methodNames separated by comma(,) : component_Name
  3. Each entry of class/package must added in a new line
  4. If methodNames are not provided, 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 the entire 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 these makes the traces lengthy. Although it can be used to study the code flow.
Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.

Help APM APM for Java Custom Instrumentation