AppDynamics Application Intelligence Platform

3.8.x Documentation

PDFs

Videos

Release Notes

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.

Overview of the App Agent for Java Installation Process

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.

Planning for Agent Installation

Before installing the App Agent for Java, be prepared with the following information.

 

Planning Item

Description

(tick)

Where is the startup script for the JVM?
If using a Java service wrapper, you need to know the location of the wrapper configuration.

This is where you can add startup arguments
in the script file and system properties, if needed.

(tick)

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).

(tick)

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.

(tick)

To what AppDynamics tier does this JVM belong?

You assign a name to the tier. For details see Logical Model.

Important Files

In addition to the JVM startup script file, two other files are important during installation:

  • The -javaagent argument uses the fully-qualified path of the javaagent.jar file. No separate classpath arguments need to be added.
  • The <agent_home>/conf/controller-info.xml file is where you add the configuration mentioned in the planning list.

To Install the Java App Server Agent

1. Download and unzip the App Agent for Java

  • Download the App Agent for Java ZIP file from AppDynamics Download Center.
  • Extract the ZIP file to the destination directory as the same user or administrator of the JVM. Take note of the following:
    • Extract the agent to a directory that is outside of your container
    • All files should be readable by the agent
    • Runtime directory should be writable by the agent

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.

2. Add the agent properties as a 'javaagent' argument to your JVM

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:

3. Configure how the agent connects to the Controller

  • Configure properties for the Controller host name and its port number.
  • You can configure these two properties using either the controller-info.xml file or the JVM startup script:

Configure using
controller-info.xml

Configure using
System Properties

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.
For SaaS Controller service: By default, port 80 is used for HTTP and 443 is used for HTTPS communication.

Optional settings for Agent-Controller communication

4. (Only for Multi-tenant mode or SaaS Installations): Configure Agent account information

  • This step is required only when the AppDynamics Controller is configured in Controller Tenant Mode or when you Use a SaaS Controller.
    (info) Skip this step if you are using single-tenant mode, which is the default in an on-premise installation.
  • Specify the properties for Account Name and Account Key. This information is provided in the Welcome email from the AppDynamics Support Team.  You can also find this information in the <controller-install>/initial_account_access_info.txt file.

Configure using
controller-info.xml

Configure using
System Properties

Required

Default

<account-name>

-Dappdynamics.agent.accountName

Required only if your Controller is configured for multi-tenant mode or
your controller is hosted.

None.

<account-access-key>

-Dappdynamics.agent.accountAccessKey

Required only if your Controller is configured for multi-tenant mode or
your controller is hosted.

None.

5. Configure how the agent identifies the AppDynamics business application, tier, and node.

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 items that are common for all the nodes in the controller-info.xml file.
  • Configure information that is unique to a node in the startup script.

Configure using
controller-info.xml

Configure using
System Properties

Required

Default

<application-name>

-Dappdynamics.agent.applicationName

Yes, unless you use automatic naming

None

<tier-name>

-Dappdynamics.agent.tierName

Yes, unless you use automatic naming

None

<node-name>

-Dappdynamics.agent.nodeName

Yes, unless you use automatic naming

None

Automatic Naming for Application, Tier, and Node

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.

Additional Installation Scenarios

Refer to the links below for typical installation scenarios, especially for cases where there are multiple JVMs on the same machine:

6. Verify agent configuration

  • Ensure that you have added -javaagent argument in your JVM startup script. This is not a -D system property but a different standard argument for all JVMs v1.5 and higher.
  • Ensure that you have added all mandatory items either in the Agent controller-info.xml file or in the JVM startup script file.
  • The user running the JVM process/application server process is the user accessing the Java Agent installation.

7. Verify successful installation and reporting

a. Verify agent installation

After a successful install, your agent logs, located at <agent_home>/logs, should contain following message:

Started AppDynamics Java Agent Successfully

(warning) 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.

b. Verify that the agent is reporting to the Controller

Use the AppDynamics UI, to verify that the Java Agent is able to connect to the Controller:

  • Point your browser to: http://<controller-host>:<controller-port>/controller
  • Provide the admin credentials to log into the AppDynamics UI.
  • Select the application. In the left navigation pane, click Servers -> App Servers -> <tier> -> <node>. Click the Agents tab and App Server Agent subtab. An agent successfully reporting to the Controller will be listed and the Reporting property shows an "up" arrow symbol. For more details see Verify App Agent-Controller Communication.
  • When deploying multiple agents for the same tier, see if you get the exact number of nodes reporting in the same tier.

Example Configuration: App Agent for Java Deployment on a Single JVM

The following example shows a sample deployment of the App Agent for Java for the ACME Bookstore.

  • Add the javaagent argument to the start-up script of the JVM:
java -javaagent:/home/appdynamics/AppServerAgent/javaagent.jar
  • Define the five mandatory items for agent configuration in the Agent controller-info.xml file:
<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>

Learn More