I am trying to implement APM stack with existing ElasticSearch & Kibana components.
I had deployed a dockerized APM Server on my http://localhost:8200 which is successfully talking to Elasticsearch. [I confirmed that it is working from Kibana UI & also by curl-ing it]
I am now trying to deploy a sample application on tomcat [which is a docker image]. My docker container runs successfully on http://localhost:8080 & my docker file looks like as below:
// FROM tomcat:8.0-alpine
// LABEL maintainer="firstname.lastname@example.org"
// ADD sample.war /usr/local/tomcat/webapps/
// ADD elastic-apm-agent-1.7.0.jar /usr/local/tomcat/
// ADD setenv.sh /usr/local/tomcat/bin/
// RUN chmod +x /usr/local/tomcat/bin/setenv.sh
// EXPOSE 8080
// CMD ["catalina.sh", "run"]
My setenv.sh file looks like as below:
// export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/usr/local/tomcat/elastic-apm-agent-1.7.0.jar"
// export CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.service_name=my-apm-agent-test"
// export CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.application_packages=org.****"
// export CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.server_urls=http://localhost:8200"
The APM agent seems to have been attached correctly but somehow it is not sending the metrics to APM -server. I am getting the following error:
// ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type METRICS with this error: Connection refused (Connection refused)
// INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 36 seconds (+/-10%)
I am not sure if I am doing something wrong. Can I please get some help with this?