Apm-agent-attach-standalone.jar I am new , elastic APM

HI ,

I am new in elastic APM , need help to setup.

I am trying to setup run Jar using "apm-agent-attach-1.21.0-standalone.jar', but i am not able to run it.

Below is my command :
java -jar '/opt/elastic/apm/apm-agent-attach-1.21.0-standalone.jar' --include '.abc.' '.abc.jar.' --config service_name=payment --config server_url=http://apm server:8200

Below is massage After run command :-1:

2021-03-23 12:33:44.482 DEBUG Not attaching the Elastic APM agent to 31654 org.apache.catalina.startup.Bootstrap -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dspring.profiles.active=load -Dwhich.job.server=load -Dhmac.key.path=/opt/tpapi -Xms2G -Xmx10G -javaagent:/opt/newrelic/newrelic.jar -javaagent:/etc/elastic-apm-agent-1.12.0.jar -Delastic.apm.service_name=LOAD -Delastic.apm.application_packages=org.example,org.another.example -Delastic.apm.server_urls=http://apm_server:8200 -javaagent:/opt/Agent/jolokia-1.6.2/agents/jolokia-jvm.jar -Djava.endorsed.dirs= -Dcatalina.base=/opt/tomcat -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp, because it is not included or excluded.
2021-03-23 12:33:44.486 DEBUG Not attaching the Elastic APM agent to 1620 org.apache.zookeeper.server.quorum.QuorumPeerMain -Xmx512M -Xms512M -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -Djava.awt.headless=true -Xloggc:/opt/kafka/bin/../logs/zookeeper-gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dkafka.logs.dir=/opt/kafka/bin/../logs -Dlog4j.configuration=file:/opt/kafka/bin/../config/log4j.properties, because it is not included or excluded.
2021-03-23 12:33:44.488 DEBUG Not attaching the Elastic APM agent to 1672 org.jruby.Main -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -Djava.awt.headless=true -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -Xmx1g -Xms256m -Xss2048k -Djffi.boot.library.path=/opt/elastic/logstash/vendor/jruby/lib/jni -Xbootclasspath/a:/opt/elastic/logstash/vendor/jruby/lib/jruby.jar -Djruby.home=/opt/elastic/logstash/vendor/jruby -Djruby.lib=/opt/elastic/logstash/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh, because it is not included or excluded.
2021-03-23 12:33:44.492 DEBUG Not attaching the Elastic APM agent to 15789 kafka.Kafka -Xmx1G -Xms1G -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -Djava.awt.headless=true -Xloggc:/opt/kafka/bin/../logs/kafkaServer-gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dkafka.logs.dir=/opt/kafka/bin/../logs -Dlog4j.configuration=file:/opt/kafka/bin/../config/log4j.properties, because it is not included or excluded.

Need s Urgent help
Thanks
Abhishek

Hi,

do you see the VMs you want to attach to when using --list (see Automatic setup with apm-agent-attach-standalone.jar | APM Java Agent Reference [1.x] | Elastic)?

If yes, you probably need to modify your --include rules. Try '.*abc.*'.

If it doesn't list your VM, make sure that you run the attacher under the same user as the target VM.

Also note that there are some upcoming changes that make attachment easier and more powerful. However, there will also be breaking changes: Attacher improvements by felixbarny · Pull Request #1667 · elastic/apm-agent-java · GitHub

Also, there was another APM agent installed in your initial message (but that have been later edited), in order to prevent any potential conflict you should probably remove -javaagent:/opt/newrelic/newrelic.jar. While that's not what is causing your issue with runtime attachment, this can likely produce unexpected errors down the road.

If you need to evaluate both agents, then make sure that at most one is enabled at the same time, otherwise unexpected side effects (and double performance overhead) could happen.

On the technical side of things, our agent relies on bytebuddy for bytecode instrumentation, which makes it compatible with most agents that also rely on it, even if they modify the same classes. NewRelic agent does not, and there might be some conflict/inconsistencies when both agents would instrument the same classes.

HI,

I have try with above but my jar are still not run.
Still showing same massage .

Thanks
Abhishek

Hi sylvain,

I am trying to replace newrelic with elastics standalone apm.

our application JAR not run with above command.

Is any other option.

Thanks
Abhishek

Hey Abhishek,

we need some more details what you've tried and what the output is.

Please try the following commands:

java -jar '/opt/elastic/apm/apm-agent-attach-1.21.0-standalone.jar' --list

Is your target application listed in the output?

jps -l

Is your target application listed in the output?

ps aux | grep java

Is your target application listed in the output?
What's the user of your target application?
Does the user match with your current user (find out what your current user is with whoami)?

HI Felixbarny,

Issue resolved , thanks for help.

Thanks
Abhishek

That's great to hear!

How did you resolve the issue?

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.