AppDynamics Application Intelligence Platform
3.9.x Documentation
The Java Agent identifies and tracks business transactions, captures statistics and diagnostic data, and analyzes and reports data to the Controller. The Java Agent uses dynamic bytecode injection to instrument a JVM and it runs as a part of the JVM process.
Caution: The Java Agent may fail if there are other Application Performance Management (APM) products installed in the same JVM. They can coexist as long as the other APM does not interfere with the Java Agent class transformations. We discourage the simultaneous use of other Byte Code Injection (BCI) agents.
Installing the Java Agent involves adding it as a javaagent (Java Programming Language Agent) on your JVM and setting up connection and identifying parameters for it to report data to the Controller.
Install the Java Agent as the same user or administrator of the JVM. Otherwise the Java Agent may not have the correct write permissions for the system. The Java Agent directories must have write permission so that AppDynamics can update the logs and other Java Agent files.
Before installing the Java Agent, be prepared with the following information.
| Planning Item | Description |
---|---|---|
Where is the startup script for the JVM? | This is where you can add startup arguments | |
What host and port is the Controller running on? | For SaaS customers, AppDynamics provides this information to you. For on-premise Controllers, this information is configured during Controller installation. See (Install the Controller on Linux or Install the Controller on Windows). | |
To what AppDynamics business application does this JVM belong? | Usually, all JVMs in your distributed application infrastructure belong to the same AppDynamics business application. You assign a name to the business application. For details see Logical Model. | |
To what AppDynamics tier does this JVM belong? | You assign a name to the tier. For details see Logical Model. |
In addition to the JVM startup script file, two other files are important during installation:
Note: Do not unzip/install the Java Agent into to the ..\tomcat\webapps directory. By default Tomcat tries to undeploy and deploy files under the webapps folder. To avoid the possibility that Tomcat will occasionally not restart, we recommend installing the Java Agent to a directory outside of tomcat, such as \usr\local\agentsetup\AppServerAgent.
This step adds the Java Agent to the startup script of your application server. Use the server-specific instructions below to add this argument for different application server JVMs:
Configure using | Configure using | Required | Default |
---|---|---|---|
<controller-host> | -Dappdynamics.controller.hostName | Yes | None |
<controller-port> | -Dappdynamics.controller.port | Yes | For On-premise Controller installations: By default, port 8090 is used for HTTP and 8181 is used for HTTPS communication. |
Optional settings for Java Agent-to-Controller communication
Configure using | Configure using | Required | Default |
---|---|---|---|
<account-name> | -Dappdynamics.agent.accountName | Required only if your Controller is configured for multi-tenant mode or | None. |
<account-access-key> | -Dappdynamics.agent.accountAccessKey | Required only if your Controller is configured for multi-tenant mode or | None. |
When configuring an Java Agent, you identify the business application, tier, and node it belongs to in the AppDynamics application model. See
Logical Model and Name Business Applications, Tiers, and Nodes for more information on this model.
You can configure these properties using either the controller-info.xml file or JVM startup script options. Use these guidelines when configuring agents:
Configure using | Configure using | Required | Default |
---|---|---|---|
<application-name> | -Dappdynamics.agent.applicationName | None | |
<tier-name> | -Dappdynamics.agent.tierName | None | |
<node-name> | -Dappdynamics.agent.nodeName | None |
The Java Agent javaagent command accepts an argument named uniqueID that AppDynamics uses to automatically name the node and tier for this Java Agent. For example, using this command argument AppDynamics will name the node and tier "my-app-jvm1":
-javaagent:<agent_home>/javaagent.jar=uniqueID=<my-app-jvm1>
When uniqueID is used and the application name is not provided either through the system property or in the controller-info.xml, AppDynamics creates a new business application called "MyApp".
The naming mechanism is used by the Java Agent Download Wizard process. See Quick Install.
Refer to the links below for typical installation scenarios, especially for cases where there are multiple JVMs on the same machine:
After a successful install, your Java Agent logs, located at <agent_home>/logs, should contain following message:
Started AppDynamics Java Agent Successfully
If the agent log file is not present, the Java Agent may not be accessing the javaagent command properties. The application server log file where STDOUT is logged will have the fallback log messages, for further troubleshooting.
Use the AppDynamics UI, to verify that the Java Agent is able to connect to the Controller:
The following example shows a sample deployment of the Java Agent for the ACME Bookstore.
java -javaagent:<install_dir_for_agent>/javaagent.jar
<controller-info> <controller-host>192.168.1.20</controller-host> <controller-port>8090</controller-port> <application-name>ACMEOnline</application-name> <tier-name>InventoryTier</tier-name> <node-name>Inventory1</node-name> </controller-info>