# Not able to distribute trace using rum agent and java agent

**URL:** <https://discuss.elastic.co/t/not-able-to-distribute-trace-using-rum-agent-and-java-agent/187580>\
**Category:** APM\
**Tags:** java, rum\
**Created:** [June 26, 2019, 1:41pm UTC](https://discuss.elastic.co/t/not-able-to-distribute-trace-using-rum-agent-and-java-agent/187580 "2019-06-26T13:41:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![farisk](https://avatars.discourse-cdn.com/v4/letter/f/f07891/32.png) [@farisk](https://discuss.elastic.co/u/farisk)\
**Post date:** [June 26, 2019, 1:41pm UTC](https://discuss.elastic.co/t/not-able-to-distribute-trace-using-rum-agent-and-java-agent/187580/1 "2019-06-26T13:41:15Z")

</div>

I want to use distribute tracing to link together the front end tracing and the backed java application to create a distributed tracing.  
i am using rum-js by injecting it to the page as well as java agent in the tomcat server.  
How to make distribute tracing work? How can i connfigure the rum js and java agent to be linked together with a same trace id?

---

<div class="post-metadata">

**Author:** ![digitalron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/digitalron/32/38224_2.png) [@digitalron](https://discuss.elastic.co/u/digitalron)\
**Post date:** [June 26, 2019, 1:57pm UTC](https://discuss.elastic.co/t/not-able-to-distribute-trace-using-rum-agent-and-java-agent/187580/2 "2019-06-26T13:57:34Z")

</div>

You have to configure **distributedTracingOrigins: ['domain1','domain2',...]** on the JS agent

You may also need to enable CORS on the Java side

---

<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:** [June 26, 2019, 2:17pm UTC](https://discuss.elastic.co/t/not-able-to-distribute-trace-using-rum-agent-and-java-agent/187580/3 "2019-06-26T14:17:31Z")

</div>

Follow through [this nice blog post](https://www.elastic.co/blog/performing-real-user-monitoring-rum-with-elastic-apm).

---

<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 17, 2019, 10:17am UTC](https://discuss.elastic.co/t/not-able-to-distribute-trace-using-rum-agent-and-java-agent/187580/4 "2019-07-17T10:17:33Z")

</div>

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