AppDynamics Application Intelligence Platform
3.8.x Documentation
The AppDynamics App Agent for Java identifies and tracks business transactions, captures statistics and diagnostic data, and analyzes and reports data to the Controller. The App Agent for Java uses dynamic bytecode injection to instrument a JVM and it runs as a part of the JVM process.
Caution: The AppDynamics Agent for Java 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 AppDynamics Agent for Java class transformations. We discourage the simultaneous use of other Byte Code Injection (BCI) agents.
Installing the App Agent for Java 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 App Agent for Java as the same user or administrator of the JVM. Otherwise the agent may not have the correct write permissions for the system. The agent directories must have write permission so that AppDynamics can update the logs and other agent files.
Before installing the App Agent for Java, 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 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 agent to a directory outside of tomcat, such as \usr\local\agentsetup\AppServerAgent.
This step adds the 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 Agent-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. |
To better understand agents and how they relate to business applications, tiers, and nodes see
Logical Model and Name Business Applications, Tiers, and Nodes.
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 App Agent for Java javaagent command accepts an argument named uniqueID that AppDynamics uses to automatically name the node and tier for this 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 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 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 App Agent for Java 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 App Agent for Java for the ACME Bookstore.
java -javaagent:/home/appdynamics/AppServerAgent/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>