# VueJS RUM distributed tracing

**URL:** <https://discuss.elastic.co/t/vuejs-rum-distributed-tracing/348937>\
**Category:** User Experience\
**Tags:** elastic-stack-monitoring\
**Created:** [December 8, 2023, 7:02pm UTC](https://discuss.elastic.co/t/vuejs-rum-distributed-tracing/348937 "2023-12-08T19:02:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![senyam08](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/senyam08/32/106230_2.png) [@senyam08](https://discuss.elastic.co/u/senyam08)\
**Post date:** [December 8, 2023, 7:02pm UTC](https://discuss.elastic.co/t/vuejs-rum-distributed-tracing/348937/1 "2023-12-08T19:02:34Z")

</div>

We have instrumented our application(Vuejs) with RUM javascript agent

We have used the following js file inserted via GTM tag  
[https://unpkg.com/@elastic/apm-rum@5.15.0/dist/bundles/elastic-apm-rum.umd.min.js](https://unpkg.com/@elastic/apm-rum@5.15.0/dist/bundles/elastic-apm-rum.umd.min.js)

We are getting RUM data with user interactions/page load/HTTP requests transaction and traces.  
We do have our java application instrumented with java agent which has 100% sampling.  
Issue is we are not seeing distributed tracing working in RUM transaction trace (we have trace with spans from RUM data and it doesnt show correlated java application trace)

Is there any other config required to enable distributed tracing across all services

Also we see separate agent js file for Vusjs ([Vue integration | APM Real User Monitoring JavaScript Agent Reference [5.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/rum-js/5.x/vue-integration.html)). It seems like only option available is add as a package and config options. Do we really need vujs specific js file to get the RUM data correlated with server side application and its downstream services. Or can we get correlation with apm-rum.js fie added into html head section?

Thanks

---

<div class="post-metadata">

**Author:** ![vigneshshanmugam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vigneshshanmugam/32/40324_2.png) [@vigneshshanmugam](https://discuss.elastic.co/u/vigneshshanmugam)\
**Post date:** [December 8, 2023, 8:45pm UTC](https://discuss.elastic.co/t/vuejs-rum-distributed-tracing/348937/2 "2023-12-08T20:45:51Z")

</div>

Hi @senyam08,

Please refer to these docs on the [RUM side](https://www.elastic.co/guide/en/apm/agent/rum-js/current/distributed-tracing-guide.html) if you have not checked already.

But in general for distributed trace to work for API calls to backends, you would need to set the `[distributedTracingOrigins](https://www.elastic.co/guide/en/apm/agent/rum-js/current/configuration.html#distributed-tracing-origins) ` header.

```auto
distributedTracingOrigins: ['https://example.com', /https?:\/\/example\.com:\d{4}/]

```

Please do let us know if that works. If not, let us know what is the setup between the client and the server and we maybe able to help better.

Thanks,  
Vignesh

---

<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:** [January 5, 2024, 8:46pm UTC](https://discuss.elastic.co/t/vuejs-rum-distributed-tracing/348937/3 "2024-01-05T20:46:33Z")

</div>

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