java-spring-jaeger icon indicating copy to clipboard operation
java-spring-jaeger copied to clipboard

Span is not linked with spring cloud gateway

Open nitin-vavdiya opened this issue 6 years ago • 12 comments
trafficstars

I am working on microservice architecture

User-------->Spring cloud gateway------------->Service A-------------->Service B

In Jaeger, It shows 2 different spans, one in gateway and other is service A --> Service B But it should be a single span ie. gateway-----> Service A----->Service B

API gateway is developed using spring cloud gateway Service A is developed using spring boot Service B is developed using spring boot

Version info for all 3 application:

compile group: 'commons-lang', name: 'commons-lang', version: '2.6' springBootVersion=2.1.4.RELEASE springDMPVersion=1.0.9.RELEASE springPlatformBomVersion=Cairo-SR8 springCloudVersion=Greenwich.SR1

nitin-vavdiya avatar May 03 '19 12:05 nitin-vavdiya

I haven't really used Spring Cloud Gateway, but here is something that might help - can you try setting:

opentracing.jaeger.enable-b3-propagation = true

in Service A and Service B please and let us know what happens?

geoand avatar May 03 '19 12:05 geoand

@geoand After applying this, the link between Service A and Service B is broken, Now it's showing three different spans for each application

nitin-vavdiya avatar May 03 '19 12:05 nitin-vavdiya

@3vild03r Can you please update your comment, it is not readable

ghost avatar May 06 '19 05:05 ghost

@nitinvavdiya Unfortunately I don't have much time to look into this now (not being familiar with Spring Cloud Gateway does not help :) ). Hopefully I will soon.

geoand avatar May 06 '19 06:05 geoand

@nitinvavdiya I fixed it, see pr: https://github.com/opentracing-contrib/java-spring-cloud/pull/233

neatlife avatar Jul 11 '19 04:07 neatlife

@neatlife In which version you fixed it?

ghost avatar Jul 22 '19 12:07 ghost

@neatlife I test the code,not work.

astrisk avatar Aug 30 '19 09:08 astrisk

Hi guys, I run into the same issue... any ideas?

We created a GlobalFilter go generate the span and pass the traceID to the next service. And it is working... but the problem is that we are creating the local spring cloud gateway span with the incoming request instead of the outgoing... that's why this solution is no good.

Does some of you how to interact with the underneath HttpClientConnect object?

I left the code explanation and also de question on stackoverglow.

Thanks in advance!

nicorbes avatar Aug 30 '19 19:08 nicorbes

@nitinvavdiya I fixed it, see pr: opentracing-contrib/java-spring-cloud#233

Hi @neatlife Will you submit again? I see that the previous submission failed.

caorui31 avatar Sep 18 '19 08:09 caorui31

I met this issue too, now any update?

HaojunRen avatar Oct 23 '19 12:10 HaojunRen

can anybody help

zhangxi123 avatar Mar 11 '21 06:03 zhangxi123

I have the exact same issue Spring Boot 2.3.1 "io.opentracing.contrib:opentracing-spring-jaeger-web-starter:3.3.1"

AhHa45 avatar Mar 22 '21 11:03 AhHa45