Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
04-07-2021 07:59 AM
Hello,
we are using a standalone machine agent to monitor a java application which is deployed in a Docker container. The machine agent is installed in a standalone container.
Our Dockerfile, where the directory ./AppServerAgent contains the machine agent:
FROM openjdk WORKDIR /app ENV APPDYNAMICS_AGENT_APPLICATION_NAME=petclinic ENV APPDYNAMICS_AGENT_TIER_NAME=petclinic-tier ENV APPDYNAMICS_AGENT_ACCOUNT_NAME=customer1 ENV APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY=41130855-4203-471e-a836-3d241c9e8794 ENV APPDYNAMICS_CONTROLLER_HOST_NAME=ec2-3-122-240-100.eu-central-1.compute.amazonaws.com ENV APPDYNAMICS_CONTROLLER_PORT=8090 ENV APPDYNAMICS_CONTROLLER_SSL_ENABLED=false ENV APPDYNAMICS_AGENT_NODE_NAME=petclinic-node COPY ./AppServerAgent/ /opt/appdynamics/ COPY ./target ./target CMD ["java", "-javaagent:/opt/appdynamics/javaagent.jar", "-jar", "target/spring-petclinic-2.4.2.jar"]
We use the official docker image of AppDynamics from the Docker Hub:
docker pull store/appdynamics/machine:4.5
And run the container with the following parameters referring to our on-prem AppD Controller:
docker run -d \ -e APPDYNAMICS_CONTROLLER_HOST_NAME=ec2-3-122-240-100.eu-central-1.compute.amazonaws.com \ -e APPDYNAMICS_CONTROLLER_PORT=8090 \ -e APPDYNAMICS_CONTROLLER_SSL_ENABLED=false \ -e APPDYNAMICS_AGENT_ACCOUNT_NAME=customer1 \ -e APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY=41130855-4203-471e-a836-3d241c9e8794 \ -e MACHINE_AGENT_PROPERTIES="-Dappdynamics.sim.enabled=true -Dappdynamics.docker.enabled=true" \ -v /proc:/hostroot/proc:ro -v /sys:/hostroot/sys:ro -v /etc:/hostroot/etc:ro -v /var/run/docker.sock:/var/run/docker.sock \ appdynamics/machine:4.5
Although the application is instrumented successfully, we can't view any Container.
We have enabled Server and Docker Visibility and our License is also fine.
What are we missing? Thanks in advance and have a nice day!
Solved! Go to Solution.
04-07-2021 11:30 AM - last edited on 10-12-2021 09:00 AM by Ryan.Paredez
Hi Christian
Is the Machine agent registered to the petclinic Application? And does the Machine agent & Java agent run on the same host?
If you click on servers,
1. Does it list the machine agent, which runs on the host that the Java Container runs on?
2. Does it under "Running on Container" field say "Yes"?
Can you add the following parameter to the "MACHINE_AGENT_PROPERTIES" section
-Dappdynamics.docker.container.containerIdAsHostId.enabled=true
Restart and check that it appears as it should
Ciao
04-08-2021 05:17 AM
Hey Mario,
The machine agent and java agent are running on the same host. I am running the machine agent as a standalone container by using the AppD image from the Docker Hub (docker pull store/appdynamics/machine:4.5). The petclinic application is running on a separate container instrumented with a java agent. I supposed that the container with the machine agent is able to detect the container with the petclinic application automatically, since it is instrumented with the java agent.
<<Is the Machine agent registered to the petclinic Application?>>
How would I do that?
Here is what I see when I click on Servers:
Best,
Christian
04-08-2021 06:31 AM
Hi Christian
Lets first resolve the correlation between the Machine agent and the App Agent correlation
From what I can see it's most likely due to the "unique host id" value that is being detected
You can read a bit up on this here
https://docs.appdynamics.com/display/PRO20X/Monitoring+Containers+with+Docker+Visibility
Extract below from link above
In a BRIDGE networking mode, the containers take on the container ID as the host name. If networking is in host mode, then the containers take on the node name of the host ID. This means every container on that node has the same host ID. In this case you need to use the unique host ID settings
Please check this and see if this is the problem, then you can set the uniquehost id accordingly
You can quickly see what happens, go into the Controller Admin Menu where you view the agents.
Check what the unique host id value is for both the java agent and the machine agent, are they both the same?
Ciao
04-08-2021 07:13 AM
Hi Mario,
I have solved the issue by deploying the Machine Agent Bundle instead of the standalone Machine Agent. As soon as I started the machine agent with <sim-enabled>true</sim-enabled> and <docker-enabled>true</docker-enabled> set to true in the controller-info.xml it worked!
So summarized you need the following for Container Monitoring:
I think that wasn't quite clear from the AppD documentation.
Thank you, Mario.
Best,
Christian
04-12-2021 11:35 AM
@Christian.Brzeski this is helpful information to share with the community! I am sure it will help other people with this question too.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form