opentracing-contrib / java-spring-jaeger

Apache License 2.0
257 stars 95 forks source link

Span is not linked with spring cloud gateway #46

Open nitin-vavdiya opened 5 years ago

nitin-vavdiya commented 5 years ago

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

geoand commented 5 years ago

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?

nitin-vavdiya commented 5 years ago

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

ghost commented 5 years ago

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

geoand commented 5 years ago

@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.

neatlife commented 5 years ago

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

ghost commented 5 years ago

@neatlife In which version you fixed it?

astrisk commented 5 years ago

@neatlife I test the code,not work.

nicorbes commented 5 years ago

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!

caorui31 commented 5 years ago

@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.

HaojunRen commented 5 years ago

I met this issue too, now any update?

zhangxi123 commented 3 years ago

can anybody help

AhHa45 commented 3 years ago

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