Smart Agent provides the auto-attach feature to auto instrument a Java application with AppDynamics Java Agent or a NodeJS application with AppDynamics NodeJS Agent. This feature is used to detect and start the supported AppDynamics agents without modifying the start configuration of the applications. You can use Smart Agent Command Line Utility for additional configuration.

Supported Runtimes and Frameworks:

  • Java: Tomcat, Weblogic, Springboot, JBoss, Glassfish and plain Java applications
  • NodeJS

Customize Auto-Attach Configuration 

You can overwrite the default ld_preload.json (attaches the agent to all supported Java frameworks and NodeJS applications) and add your own with your updated rules. The default location for ld_preload.json is /etc/opt/appdynamics/ld_preload.json.

The default auto-attach path is same as the agent path, which is defined at the root level.

For Java Agent, you can specify the required agent path for each regex within the ld_preload.json file. This allows specific Java agent to auto-attach to a specific Java service.

To use advanced auto-attach configuration or configure auto-attach on multiple hosts in an automated way, you can use Smart Agent Command Line Utility.

Filters

The JSON configuration is broken into sections per supported runtime. For example, Java, NodeJS. For each section, you can provide a set of filters using regular expressions and also define a filter to auto attach or ignore the discovered application(s).  The filters are applied in an order. The regular expressions are applied to the entire command line.

Example regex:
 {
        "name": "instrument node applications",
        "regex": "node .*\\.js.*$",
        "instrument": true
      },

     {
        "name": "ignore npm commands",
        "regex": "npm",
        "instrument": false
      } 
JSON

Startup scripts such as, /opt/tomcat/bin/startup.sh launch the Java applications internally with certain parameters. Auto-attach monitors the launch of the Java application and not of the shell script(s).