# JMS instrumentation with APM

**URL:** <https://discuss.elastic.co/t/jms-instrumentation-with-apm/303147>\
**Category:** APM\
**Tags:** java, server\
**Created:** [April 25, 2022, 10:28am UTC](https://discuss.elastic.co/t/jms-instrumentation-with-apm/303147 "2022-04-25T10:28:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raushan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raushan/32/102180_2.png) [@Raushan](https://discuss.elastic.co/u/Raushan)\
**Post date:** [April 25, 2022, 10:28am UTC](https://discuss.elastic.co/t/jms-instrumentation-with-apm/303147/1 "2022-04-25T10:28:23Z")

</div>

Hi,

we are using java apm agent version `1.30.0` with JMS Artemis ActiveMQ Server. Config is

```auto
CREATE_ARGUMENTS="${CREATE_ARGUMENTS} -javaagent /var/lib/artemis-instance/elastic-apm-agent-${ELASTIC_APM_AGEN_VERSION}.jar"
CREATE_ARGUMENTS="${CREATE_ARGUMENTS} -Delastic.apm.server_url ${APM_SERVER_URI}"
CREATE_ARGUMENTS="${CREATE_ARGUMENTS} -Delastic.apm.verify_server_cert false"
CREATE_ARGUMENTS="${CREATE_ARGUMENTS} -Delastic.apm.service_name activemq-service"
CREATE_ARGUMENTS="${CREATE_ARGUMENTS} -Delastic.apm.application_packages "

```

But MQ doesn't connects with APM. Any idea? Is packages need to be changed  
`-Delastic.apm.application_packages`  
Is there any docs?  
Logs of MQ server

```auto
CREATE_ARGUMENTS=--user admin --password admin --silent --allow-anonymous --http-host 0.0.0.0 --relax-jolokia -Delastic.apm.server_url https://ip:8200 -Delastic.apm.verify_server_cert false -Delastic.apm.service_name activemq-service -Delastic.apm.application_packages
Creating ActiveMQ Artemis instance at: /var/lib/artemis-instance

Auto tuning journal ...
done! Your system can make 8.62 writes per millisecond, your journal-buffer-timeout will be 115999

You can now start the broker by executing:  

   "/var/lib/artemis-instance/bin/artemis" run

Or you can run the broker in the background using:

   "/var/lib/artemis-instance/bin/artemis-service" start

     _ _ _
    / \ ____| |____  ____ (_) _____
   / _ \| _ \ __|/ _ \ \/ | |/__ /
  / ___\ | \/ |_/__ / |\/| | |\___ \
 /_/ \_\| \ __\____ |_| |_|_|/___ /
 Apache ActiveMQ Artemis 2.17.0

Apr 25, 2022 10:07:48 AM java.lang.System$LoggerFinder lambda$accessProvider$0
WARNING: Failed to instantiate LoggerFinder provider; Using default.
2022-04-25 10:07:48,137 INFO [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server
2022-04-25 10:07:48,211 INFO [org.apache.activemq.artemis.core.server] AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=false,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/large-messages,pagingDirectory=data/paging)
.........................

```

---

<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:** [April 25, 2022, 12:58pm UTC](https://discuss.elastic.co/t/jms-instrumentation-with-apm/303147/2 "2022-04-25T12:58:38Z")

</div>

Hi !

The APM agent instruments JMS clients, not JMS servers, which explains why it's not supported.  
Unless the ActiveMQ Artemis server is implemented on top of a [supported technology](https://www.elastic.co/guide/en/apm/agent/java/current/supported-technologies-details.html), then it won't be supported by the agent with automatic instrumentation.

However, you might be able to use manual tracing with using one [Tracing API](https://www.elastic.co/guide/en/apm/agent/java/current/apis.html) and then use server-specific hooks to create transactions and spans for APM.

Also, there is usually little value to instrument the JMS/Messaging server itself as capturing detailed tracing is only relevant if you have knowledge of its internal architecture and have the ability to change its behavior through configuration or code changes.

Could you elaborate a bit on your context and what information do you expect to get from deploying the APM agent on this server ?

---

<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:** [May 16, 2022, 8:59am UTC](https://discuss.elastic.co/t/jms-instrumentation-with-apm/303147/3 "2022-05-16T08:59:08Z")

</div>

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