# Java trace between different services, instances

**URL:** <https://discuss.elastic.co/t/java-trace-between-different-services-instances/188975>\
**Category:** APM\
**Tags:** java\
**Created:** [July 4, 2019, 9:21pm UTC](https://discuss.elastic.co/t/java-trace-between-different-services-instances/188975 "2019-07-04T21:21:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zolthar-z](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zolthar-z/32/47895_2.png) [@zolthar-z](https://discuss.elastic.co/u/zolthar-z)\
**Post date:** [July 4, 2019, 9:21pm UTC](https://discuss.elastic.co/t/java-trace-between-different-services-instances/188975/1 "2019-07-04T21:21:29Z")

</div>

Good Day

I have an application that is composed for several Java services distributed in different servers, right now I have apm java agent installed in each server and can collect the data from each server without problem. now we want to have a major overview of the platform and the idea is have a trace that show how a request made by a client go for each server, I was wondering if some of you know how can I configure the apm java agent to have this global view and how all servers related between them

Thanks.

Regards.

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [July 5, 2019, 2:34am UTC](https://discuss.elastic.co/t/java-trace-between-different-services-instances/188975/2 "2019-07-05T02:34:48Z")

</div>

Hi Luis,

If you use the [supported technologies](https://www.elastic.co/guide/en/apm/agent/java/current/supported-technologies-details.html), then the Java agent should automatically trace requests between the servers/services.

How do your applications communicate with each other?

---

<div class="post-metadata">

**Author:** ![zolthar-z](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zolthar-z/32/47895_2.png) [@zolthar-z](https://discuss.elastic.co/u/zolthar-z)\
**Post date:** [July 5, 2019, 3:47pm UTC](https://discuss.elastic.co/t/java-trace-between-different-services-instances/188975/3 "2019-07-05T15:47:42Z")

</div>

Hi

Thanks for your response,

They use JMS for communication,

I have the agent 1.7.0 and apm-server 7.2 with the default configuration, should I set up any special parameter?

Regards.

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [July 7, 2019, 2:15am UTC](https://discuss.elastic.co/t/java-trace-between-different-services-instances/188975/4 "2019-07-07T02:15:36Z")

</div>

Hi Luis,

> [@zolthar-z](#):
>
> should I set up any special parameter?

Yes! JMS support was just added in 1.7.0. Since it's new and we are in the process of evaluating what we need to do to provide full support for messaging systems in our APM solution as a whole, it was added as an "incubating" feature, which means it is still off by default. As said in [the documentation](https://www.elastic.co/guide/en/apm/agent/java/current/supported-technologies-details.html#supported-messaging-frameworks):

> In order to enable, set the [`disable_instrumentations`](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-disable-instrumentations) config option to an empty string

I hope this helps,  
Eyal.

---

<div class="post-metadata">

**Author:** ![zolthar-z](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zolthar-z/32/47895_2.png) [@zolthar-z](https://discuss.elastic.co/u/zolthar-z)\
**Post date:** [July 8, 2019, 2:43pm UTC](https://discuss.elastic.co/t/java-trace-between-different-services-instances/188975/5 "2019-07-08T14:43:03Z")

</div>

Hi

Thanks for your help

we had (in theory) the instrumentations enabled but is not working, we only can see the trace from the local services and not the whole platform,

On the systemd file that executes the java application we have

ExecStart=/usr/bin/java -javaagent:/opt/apm/java/elastic-apm-agent-1.7.0.jar -Delastic.apm.disable\_instrumentations=jms -Delastic.ap  
m.service\_name=servicename -Delastic.apm.server\_urls=http://ipaddress:8200 -Xmx4096m -jar service.jar --spring.profiles.  
active=stage --server.port=8081 \

I'm really sure that I'm doing something wrong but I don't know what it is

Any help is more than welcome.

Regards.

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [July 8, 2019, 2:56pm UTC](https://discuss.elastic.co/t/java-trace-between-different-services-instances/188975/6 "2019-07-08T14:56:48Z")

</div>

Hi Luis,

Change `-Delastic.apm.disable_instrumentations=jms` to `-Delastic.apm.disable_instrumentations=`. This should make the JMS work

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [July 8, 2019, 3:00pm UTC](https://discuss.elastic.co/t/java-trace-between-different-services-instances/188975/7 "2019-07-08T15:00:07Z")

</div>

> [@zolthar-z](#):
>
> ExecStart=/usr/bin/java -javaagent:/opt/apm/java/elastic-apm-agent-1.7.0.jar -Delastic.apm.disable\_instrumentations=jms -Delastic.ap  
> m.service\_name=servicename -Delastic.apm.server\_urls=[http://ipaddress:8200](http://ipaddress:8200) -Xmx4096m -jar service.jar --spring.profiles.  
> active=stage --server.port=8081 \

In addition to @Eyal_Koren instructions, you might want to check to make sure that trailing `\` required as well? that usually means the next line is a continuation of the current line.

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [July 8, 2019, 3:01pm UTC](https://discuss.elastic.co/t/java-trace-between-different-services-instances/188975/8 "2019-07-08T15:01:09Z")

</div>

Can you describe what you use at the JMS consumer side? A MessageListener? The `receive` API?

---

<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:** [July 29, 2019, 11:01am UTC](https://discuss.elastic.co/t/java-trace-between-different-services-instances/188975/9 "2019-07-29T11:01:09Z")

</div>

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