Hello,
I am trying to attach JAVA APM Agent with my SpringBoot Application manually. I am using the generic setup for doing this:
java -javaagent:/root/elastic-apm-agent-1.7.0.jar -Delastic.apm.service_name=AZS-FE-APM-AGENT-JAVA -Delastic.apm.application_packages=org.****** -Delastic.apm.server_urls=http://apm-server-service.mon.svc.cluster.local:8200 -jar amp-azs-fe-1.0.1.jar
This application is dockerized & /root is my working directory. I have copied the the elastic-apm-agent, my-application-jar & the startup-script in this working directory.
My startup-script looks something like this:
#!bin/busybox
echo "Deploying AzS-FE Application....."
java -javaagent:/root/elastic-apm-agent-1.7.0.jar -Delastic.apm.service_name=AZS-FE-APM-AGENT-JAVA -Delastic.apm.application_packages=org.**** -Delastic.apm.server_urls=http://apm-server-service.mon.svc.cluster.local:8200 -jar amp-azs-fe-1.0.1.jar
echo "Deployment process complete...."
sleep 5
tail -f /root/logs/events.log
& my DockerFile looks like this:
FROM java:openjdk-8-jre-alpine
RUN cd /root && mkdir logs
COPY target/amp-azs-fe-1.0.1.jar /root/amp-azs-fe-1.0.1.jar
COPY elastic-apm-agent-1.7.0.jar /root/elastic-apm-agent-1.7.0.jar
COPY azs-fe_start.sh /root
ENV LOGROOT /root/logs
WORKDIR /root
ENTRYPOINT ["sh","azs-fe_start.sh"]
I feel that somehow Tomcat is not getting instrumented with this agent.
These are the file permissions for the above file in my container:
~ # pwd
/root
~ # ls -ltr
total 29656
-rw-r--r-- 1 root root 4857209 Aug 2 16:46 elastic-apm-agent-1.7.0.jar
-rw-r--r-- 1 root root 382 Aug 2 16:46 azs-fe_start.sh
-rw-r--r-- 1 root root 25501343 Aug 2 16:47 amp-azs-fe-1.0.1.jar
drwxr-xr-x 2 root root 4096 Aug 2 16:47 logs
~ #
I am pretty sure that I might be missing some bridge variables here. Any suggestions would help. Thanks in advance!