# Observe "Could not inject distributed tracing header to the request origin ('http://local.testrum.com:8106') from the current origin ('http://local.testrum.com:3000')

**URL:** <https://discuss.elastic.co/t/observe-could-not-inject-distributed-tracing-header-to-the-request-origin-http-local-testrum-com-8106-from-the-current-origin-http-local-testrum-com-3000/248267>\
**Category:** APM\
**Tags:** rum, server\
**Created:** [September 11, 2020, 6:09am UTC](https://discuss.elastic.co/t/observe-could-not-inject-distributed-tracing-header-to-the-request-origin-http-local-testrum-com-8106-from-the-current-origin-http-local-testrum-com-3000/248267 "2020-09-11T06:09:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ravi\_Krishnamurthy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravi_krishnamurthy/32/48088_2.png) [@Ravi\_Krishnamurthy](https://discuss.elastic.co/u/Ravi_Krishnamurthy)\
**Post date:** [September 11, 2020, 6:09am UTC](https://discuss.elastic.co/t/observe-could-not-inject-distributed-tracing-header-to-the-request-origin-http-local-testrum-com-8106-from-the-current-origin-http-local-testrum-com-3000/248267/1 "2020-09-11T06:09:53Z")

</div>

Trying out Elastic APM for distributed tracing with a react front end ([http://local.testrum.com:3000](http://local.testrum.com:3000)) served by springboot backend ([http://local.testrum.com:8106](http://local.testrum.com:8106))

Observe the following  
Could not inject distributed tracing header to the request origin ('[http://local.testrum.com:8106](http://local.testrum.com:8106)') from the current origin ('[http://local.testrum.com:3000](http://local.testrum.com:3000)')

React configuration

```auto
<script src="http://local.testrum.com:3000/elastic-apm-rum.umd.js" crossorigin></script>

  <script>

    elasticApm.init({

      serviceName: 'reactapp',

      logLevel: 'debug',

      serverUrl: 'http://local.testrum.com:8200',

      distributedTracing:true,

      distributedTracingOrigins: ['http://local.testrum.com']

    })

  </script>

```

APM Server

```auto
rum:
    enabled: true

```

Please advice

---

<div class="post-metadata">

**Author:** ![Ravi\_Krishnamurthy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravi_krishnamurthy/32/48088_2.png) [@Ravi\_Krishnamurthy](https://discuss.elastic.co/u/Ravi_Krishnamurthy)\
**Post date:** [September 13, 2020, 1:44am UTC](https://discuss.elastic.co/t/observe-could-not-inject-distributed-tracing-header-to-the-request-origin-http-local-testrum-com-8106-from-the-current-origin-http-local-testrum-com-3000/248267/2 "2020-09-13T01:44:17Z")

</div>

> [@Ravi\_Krishnamurthy](#):
>

Able to get it working but updating the below conf. Now sure why it works but works fine.

```auto
distributedTracingOrigins: ['http://local.testrum.com:3000','http://local.testrum.com:8106']

```

---

<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:** [September 14, 2020, 8:43am UTC](https://discuss.elastic.co/t/observe-could-not-inject-distributed-tracing-header-to-the-request-origin-http-local-testrum-com-8106-from-the-current-origin-http-local-testrum-com-3000/248267/3 "2020-09-14T08:43:19Z")

</div>

Glad you figured out. Yes the users would need to add the `remote` host to the `distributedTracingOrigins` as the agent would add `traceparent` header to all the outgoing requests which might end up in CORS issue if the users aren't aware of the action they are performing.

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:** [October 5, 2020, 4:43am UTC](https://discuss.elastic.co/t/observe-could-not-inject-distributed-tracing-header-to-the-request-origin-http-local-testrum-com-8106-from-the-current-origin-http-local-testrum-com-3000/248267/4 "2020-10-05T04:43:33Z")

</div>

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