Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As an alternative to using system properties or controller-info.xml to configure the application name, tier name, and node name, or other agent settings, you can use so on, you can configure the agent based on environment variables. Environment variables give you an additional option another mechanism for configuring the agent based on dynamically set values.    

...

To configure the agent with environment variables, simply set the value of the appropriate environment variables listed below to the value you want to use in the agent.variable in the environment in which the monitored application runs.

There are environment variables defined most of the agent settings you can configure in the controller-info.xml file. For example, there are variables for the application name, node name, Controller connection settings, and more.  

For example, if you set the value of the APPDYNAMICSto set the node name for the agent using an environment variable, use the APPDYNAMICS_AGENT_NODE_NAME variable, as below, the agent automatically takes the value of . The following command sets the variable to node23. When the agent subsequently starts up, it automatically takes node23 as its node name.: 

No Format
export APPDYNAMICS_AGENT_NODE_NAME=node23

When settings are configured in different. Environment variable, system property and then Since an agent setting can be specified in several places, the agent applies the following order of priority in taking a value for the setting:  

  1. Environment variable 
  2. System property 
  3. controller-info.xml

...


For each setting, the agent checks each for settings, and for a particular settings,  uses the setting for the first of these (given the order of priority) that is not empty.

List of Variables

The following environment properties can be used today to configure the agent.

of these sources. For the value, the agent uses the value from the first source that contains a non-empty value (based on the order shown).

Environment Variables

You can use the following environment variables to configure the Java Agent. 

Environment VariableEquivalent property
APPDYNAMICS_CONTROLLER_HOST_NAME<controller-host>
APPDYNAMICS_CONTROLLER_PORT<controller-port>
APPDYNAMICS_CONTROLLER_SSL_ENABLED<controller-ssl-enabled>
APPDYNAMICS_AGENT_APPLICATION_NAME<application-name>
APPDYNAMICS_AGENT_TIER_NAME<tier-name>
APPDYNAMICS_AGENT_NODE_NAME<node-name>
APPDYNAMICS_AGENT_ACCOUNT_NAME_ENV_VAR<account-name>
APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY_ENV_VAR<account-access-key>
APPDYNAMICS_AGENT_UNIQUE_HOST_ID_ENV_VARUnique host name
APPDYNAMICS_AGENT_BASE_DIR

Example

The following example would be resolved to a tierName=tier1 and a nodeName=node32

Code Block
export APPDYNAMICS_AGENT_NODE_NAME=node23
java … -Dmytier.name=tier1 –-Dappdynamics.agent.tierName=$mytier.name
 

For app and machine agent config properties

Machine Agent Configuration Properties

Java App Agent Configuration Properties

FAQS

Q: What is the order of precedence of system properties, environment variables, and controller-info.xml.

A: 

Q: What happens if the settings conflict?

A: The order is followed and the first one that is non-empty is picked up.

Q: The above list covers many, but not all, of the system properties that are in the product docs. Is there one environment variable that corresponds to every property?

A: These are all the environment variables that we support.

Q: Are there additional environment variables to document that do not have corresponding properties?

A: No.

Any Dev Followups?

N/A

Contributors

Tom Rabaut
Vinay Srini
Michael Margulis

<agent-runtime-dir>