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

**URL:** <https://discuss.elastic.co/t/apm-agent-attach-standalone-jar-i-am-new-elastic-apm/268049>\
**Category:** APM\
**Tags:** java\
**Created:** [March 23, 2021, 7:06am UTC](https://discuss.elastic.co/t/apm-agent-attach-standalone-jar-i-am-new-elastic-apm/268049 "2021-03-23T07:06:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_Tiwari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhishek_tiwari1/32/77345_2.png) [@Abhishek\_Tiwari1](https://discuss.elastic.co/u/Abhishek_Tiwari1)\
**Post date:** [March 23, 2021, 7:06am UTC](https://discuss.elastic.co/t/apm-agent-attach-standalone-jar-i-am-new-elastic-apm/268049/1 "2021-03-23T07:06:30Z")

</div>

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 👎

```auto
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

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [March 23, 2021, 7:27am UTC](https://discuss.elastic.co/t/apm-agent-attach-standalone-jar-i-am-new-elastic-apm/268049/2 "2021-03-23T07:27:15Z")

</div>

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](https://www.elastic.co/guide/en/apm/agent/java/current/setup-attach-cli.html#setup-attach-cli-usage-options))?

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](https://github.com/elastic/apm-agent-java/pull/1667)

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [March 23, 2021, 8:17am UTC](https://discuss.elastic.co/t/apm-agent-attach-standalone-jar-i-am-new-elastic-apm/268049/3 "2021-03-23T08:17:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Abhishek\_Tiwari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhishek_tiwari1/32/77345_2.png) [@Abhishek\_Tiwari1](https://discuss.elastic.co/u/Abhishek_Tiwari1)\
**Post date:** [March 24, 2021, 4:17am UTC](https://discuss.elastic.co/t/apm-agent-attach-standalone-jar-i-am-new-elastic-apm/268049/4 "2021-03-24T04:17:31Z")

</div>

HI,

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

Thanks  
Abhishek

---

<div class="post-metadata">

**Author:** ![Abhishek\_Tiwari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhishek_tiwari1/32/77345_2.png) [@Abhishek\_Tiwari1](https://discuss.elastic.co/u/Abhishek_Tiwari1)\
**Post date:** [March 24, 2021, 4:20am UTC](https://discuss.elastic.co/t/apm-agent-attach-standalone-jar-i-am-new-elastic-apm/268049/5 "2021-03-24T04:20:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [March 24, 2021, 6:39am UTC](https://discuss.elastic.co/t/apm-agent-attach-standalone-jar-i-am-new-elastic-apm/268049/6 "2021-03-24T06:39:01Z")

</div>

Hey Abhishek,

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

Please try the following commands:

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

```

Is your target application listed in the output?

```auto
jps -l

```

Is your target application listed in the output?

```auto
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`)?

---

<div class="post-metadata">

**Author:** ![Abhishek\_Tiwari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhishek_tiwari1/32/77345_2.png) [@Abhishek\_Tiwari1](https://discuss.elastic.co/u/Abhishek_Tiwari1)\
**Post date:** [March 25, 2021, 8:54am UTC](https://discuss.elastic.co/t/apm-agent-attach-standalone-jar-i-am-new-elastic-apm/268049/7 "2021-03-25T08:54:33Z")

</div>

HI Felixbarny,

Issue resolved , thanks for help.

Thanks  
Abhishek

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [March 25, 2021, 10:07am UTC](https://discuss.elastic.co/t/apm-agent-attach-standalone-jar-i-am-new-elastic-apm/268049/8 "2021-03-25T10:07:15Z")

</div>

That's great to hear!

How did you resolve the issue?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 15, 2021, 6:07am UTC](https://discuss.elastic.co/t/apm-agent-attach-standalone-jar-i-am-new-elastic-apm/268049/9 "2021-04-15T06:07:34Z")

</div>

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