# Integration between RUM traces and backend traces (distributed tracing)

**URL:** <https://discuss.elastic.co/t/integration-between-rum-traces-and-backend-traces-distributed-tracing/373739>\
**Category:** APM\
**Tags:** rum\
**Created:** [January 27, 2025, 4:34pm UTC](https://discuss.elastic.co/t/integration-between-rum-traces-and-backend-traces-distributed-tracing/373739 "2025-01-27T16:34:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zvazquez](https://avatars.discourse-cdn.com/v4/letter/z/c0e974/32.png) [@zvazquez](https://discuss.elastic.co/u/zvazquez)\
**Post date:** [January 27, 2025, 4:34pm UTC](https://discuss.elastic.co/t/integration-between-rum-traces-and-backend-traces-distributed-tracing/373739/1 "2025-01-27T16:34:21Z")

</div>

Hi,

We have started our journey to implement RUM using rum-js 5.16.3 and we have been able to implemented in our UI where we can capture user interactions and capture HTTP requests

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d5915f889f66c8b1918418bcdcb13fc3f380f658.png)

Certainly the trace.id is included in the metadata

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/5/25334888fb4615b54ee1a5c9f76ad7540239ba7c.png)

But the problem consists that backend services (which are also instrumented) are not shown in the waterfall diagram, only HTTP requests to them trigger by the browser.

Now, while we search using the trace.id from the original RUM transaction, we can see all the backend microservices which were involved in the requests, but not visible from the original RUM transaction.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/9/e932a71e7f5188037dab4495c3b3133fb303c354.png)

**Is there something that can be done to be able to display the full waterfall diagram or navigate from the original RUM trace into all the backend traces without having to search by the trace.id?**

**Kibana version** : v 8.16.2

**Elasticsearch version** : v 8.16.2

**APM Server version** : 8.16.2

**APM Agent language and version** : rum-js 5.16.3

**Browser version** : Chrome 131.0.677

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [January 27, 2025, 4:53pm UTC](https://discuss.elastic.co/t/integration-between-rum-traces-and-backend-traces-distributed-tracing/373739/2 "2025-01-27T16:53:16Z")

</div>

Can you share your RUM configuration and confirm if you are using the `distributedTracingOrigins` option [as per the documentation](https://www.elastic.co/guide/en/apm/agent/rum-js/current/distributed-tracing-guide.html#:~:text=Distributed%20tracing%20is%20enabled%20by,set%20the%20distributedTracingOrigins%20configuration%20option.)?

---

<div class="post-metadata">

**Author:** ![SanketBhat](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@SanketBhat](https://discuss.elastic.co/u/SanketBhat)\
**Post date:** [February 4, 2025, 2:21pm UTC](https://discuss.elastic.co/t/integration-between-rum-traces-and-backend-traces-distributed-tracing/373739/3 "2025-02-04T14:21:44Z")

</div>

Hi @carly.richmond ,  
I am working with @zvazquez . I have gone through the given documentation and understand that we do not need `distributedTracingOrigins` as we are not doing cross origin requests. Here is the config RUM js agent initialized with :

 ![RUMAgentConfigObj](https://us1.discourse-cdn.com/elastic/original/3X/8/0/80dfdaaffd9b87482a2feddd06b4f1467eb556a8.png)

---

<div class="post-metadata">

**Author:** ![SanketBhat](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@SanketBhat](https://discuss.elastic.co/u/SanketBhat)\
**Post date:** [February 4, 2025, 2:41pm UTC](https://discuss.elastic.co/t/integration-between-rum-traces-and-backend-traces-distributed-tracing/373739/4 "2025-02-04T14:41:22Z")

</div>

Additionally, what I noticed is that RUM agent is setting `traceparent` request header on all network calls, however when we look at the APM page it only shows front-end traces and If I filter traces with same traceId from the `traceparent` header, I am able to see traces across backend and front-end. [Attached all 3 screenshots below:]

 ![ScreeshotsMerged](https://us1.discourse-cdn.com/elastic/original/3X/9/c/9c524ad09804f1f80af14fd8365a79ece2af43dd.jpeg)

What could be the issue here? What needs to be done to show both backend and front-end spans in a single trace?

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [February 12, 2025, 9:48am UTC](https://discuss.elastic.co/t/integration-between-rum-traces-and-backend-traces-distributed-tracing/373739/5 "2025-02-12T09:48:16Z")

</div>

Hi @zvazquez and @SanketBhat,

Thanks for the additional information. Can you confirm what you are using for instrumenting the backend services?

Can you also check the presence and value of the [`tracestate` header](https://www.elastic.co/guide/en/apm/agent/rum-js/current/distributed-tracing-guide.html#enable-tracestate) in addition to the `traceparent` header details you have provided?
