# Spring cloud gateway distribute to other service, transaction.id is different

**URL:** <https://discuss.elastic.co/t/spring-cloud-gateway-distribute-to-other-service-transaction-id-is-different/280049>\
**Category:** APM\
**Tags:** java\
**Created:** [July 30, 2021, 7:41am UTC](https://discuss.elastic.co/t/spring-cloud-gateway-distribute-to-other-service-transaction-id-is-different/280049 "2021-07-30T07:41:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![black295](https://avatars.discourse-cdn.com/v4/letter/b/a9a28c/32.png) [@black295](https://discuss.elastic.co/u/black295)\
**Post date:** [July 30, 2021, 7:41am UTC](https://discuss.elastic.co/t/spring-cloud-gateway-distribute-to-other-service-transaction-id-is-different/280049/1 "2021-07-30T07:41:07Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

TIP 1: select at least one tag that further categorizes your topic. For example `server` for APM Server related questions, `java` for questions regarding the Elastic APM Java agent, or `ui` for questions about the APM App within Kibana.

TIP 2: Check out the [troubleshooting guide](https://www.elastic.co/guide/en/apm/get-started/current/troubleshooting.html) first. Not only will it help you to resolve common problems faster but it also explains in more detail which information we need before we can properly help you.

**Kibana version** :7.10.2

**Elasticsearch version** :7.10.2

**APM Server version** :7.10.2

**APM Agent language and version** : 1.25.0 java

**Browser version** :

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:

**Fresh install or upgraded from other version?**

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

**Steps to reproduce** :  
1.create a spring cloud gateway application  
2.create a service  
3.visit a route, gateway distribute to A service, the gateway transaction.id is different from A service transaction.id

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/d/cd5ab2c118a2564e86a2790c9f1f0e28a07ffe0e.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/1/c1b052e0da4979b36ffbf6644b6af56942e2074d.png)

**Errors in browser console (if relevant)**:

**Provide logs and/or server output (if relevant)**:

---

<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:** [August 1, 2021, 4:18am UTC](https://discuss.elastic.co/t/spring-cloud-gateway-distribute-to-other-service-transaction-id-is-different/280049/2 "2021-08-01T04:18:55Z")

</div>

We probably don't support either an asynchronous mechanism used within the framework, or the web client it uses to make the routed request (maybe WebFlux client?)

---

<div class="post-metadata">

**Author:** ![black295](https://avatars.discourse-cdn.com/v4/letter/b/a9a28c/32.png) [@black295](https://discuss.elastic.co/u/black295)\
**Post date:** [August 3, 2021, 1:57am UTC](https://discuss.elastic.co/t/spring-cloud-gateway-distribute-to-other-service-transaction-id-is-different/280049/4 "2021-08-03T01:57:51Z")

</div>

probably?it is a pity that apm can't support the framework. The framework is based on WebFlux .Can we fit it ?

---

<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:** [August 3, 2021, 2:56am UTC](https://discuss.elastic.co/t/spring-cloud-gateway-distribute-to-other-service-transaction-id-is-different/280049/5 "2021-08-03T02:56:01Z")

</div>

> [@black295](#):
>
> probably?

Yes, that's the word I use when I have an hypothesis that is not verified. You are welcome to verify and let us know, or wait until we get to that.

> [@black295](#):
>
> it is a pity that apm can't support the framework. The framework is based on WebFlux

Our agent's support for WebFlux is still [experimental](https://www.elastic.co/guide/en/apm/agent/java/current/supported-technologies-details.html#supported-web-frameworks), partly because we did not get to the HTTP client implementation yet. You are welcome to register to receive notifications from [the related GitHub issue](https://github.com/elastic/apm-agent-java/issues/1306).

> [@black295](#):
>
> Can we fit it ?

Yes. If you don't want to wait for the inherent support, check out our [public API](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html). It now offers new APIs to [create exit spans](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-span-start-exit-span-with-type) and set their [destination service metadata](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-span-set-destination-resource) so that the downstream service is treated as such and added to the service map.

---

<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:** [August 23, 2021, 10:56pm UTC](https://discuss.elastic.co/t/spring-cloud-gateway-distribute-to-other-service-transaction-id-is-different/280049/6 "2021-08-23T22:56:43Z")

</div>

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