On this page:

 

Related pages:

Your Rating:
Results:
PatheticBadOKGoodOutstanding!
1 rates

You can deploy and run AppDynamics App Agents inside Docker containers with no additional configuration. You can also use orchestration frameworks such as Kubernetes and Ansible to set up containers with the desired agents.

Before You Start

Note the following:

  • AppDynamics recommends that you use Docker CE/EE v17.03 (or higher) or Docker Engine v1.13 (or higher).
  • Before you deploy an agent, review the Best Practices for Configuring App Agents in Containers (below).

Use an Official AppDynamics Image

The quickest and easiest way to run a container with an App Agent installed is to use one of the official AppDynamics Images from the Docker Store. These images are produced by AppDynamics and based on certified base images from the Docker community. You can run these images directly or use them as base images for your own application containers. 

If you prefer to build your base images, you can use the full source code on GitHub as a pattern for your own builds: https://github.com/Appdynamics/appdynamics-docker-images.

Best Practices for Configuring App Agents in Containers 

You should set the following properties for App Agents running in containers. See Java Agent Configuration Properties for details of how to configure these properties.

  • Reuse Node Name and Reuse Node Name Prefix – With these settings specified, the Controller reuses the node name after a container is shut down and marked as historical. See the Configuring the Agent for Dynamic Environments section.
  • Agent Runtime Dir – The runtime directory where the agent stores agent logs and config files. This can be a shared volume (Docker) or persistent storage (Kubernetes), mounted into the container. Specifying a runtime directory outside the container ensures that agent logs are accessible after the container is stopped. 
  • Mark Node Name as Historical – This setting is important to ensure that an agent does not keep consuming a license after the node shuts down. See the Marking Dynamic Nodes as Historical at Shutdown section. 

Example: Run the Java Agent using Docker from the Command Line 

docker run -d --name <app-container-name> \
-v <host-folder-with-java-agent>:/java-agent \
-e APPDYNAMICS_CONTROLLER_HOST_NAME=<controller-host> \
-e APPDYNAMICS_CONTROLLER_PORT=<controller-port> \
-e APPDYNAMICS_CONTROLLER_SSL_ENABLED=<true|false> \
-e APPDYNAMICS_AGENT_ACCOUNT_NAME=customer1 \
-e APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \
-e APPDYNAMICS_AGENT_APPLICATION_NAME=Liferay \
-e APPDYNAMICS_AGENT_TIER_NAME=Tomcat \
-e CATALINA_OPTS="-Dappdynamics.agent.reuse.nodeName.prefix=Tomcat -Dappdynamics.agent.reuse.nodeName=true -javaagent:/java-agent/javaagent.jar" \
snasello/liferay-6.2

Redirecting Agent Output to Stdout

It is normally best practice to have all logging output redirected to stdout in containerized environments. To redirect the output of the AppDynamics APM agent to stdout, edit the log4j.xml configuration file and add the following line:

<appender-ref ref="ConsoleAppender”/> under the <logger name="com.singularity" additivity="false”>
  • No labels