opentracing-contrib / java-spring-web

OpenTracing Spring Web instrumentation
Apache License 2.0
108 stars 59 forks source link

add uber-trace-id for request header #110

Open aslongyouloveme opened 5 years ago

aslongyouloveme commented 5 years ago

so microservice can get this for inherit span

pavolloffay commented 5 years ago

@aslongyouloveme could you please help me understand this change and describe why it is needed?

The request already contains span context. This span context was used as a parent to span created in the subscribe method.

aslongyouloveme commented 5 years ago

I used springcloud-gateway as the gateway, and downstream order-to-service is a micro service, gateway is a webflux application, and order-to-service is a servlet application. When I integrated jaeger, order-to-service could not get spancontext of gateway, because header (ude-trace-id) was not added in the forwarded request header. @

aslongyouloveme commented 5 years ago

@pavolloffay

pavolloffay commented 5 years ago

It sounds fine, thanks for the explanation. Could you write a test for the functionality you are adding?

aslongyouloveme commented 5 years ago

I would like to write a test case for it, I did not find any specimen test case for ‘TracingOperator.java’. It seams difficult to mock ServerWebExchange that has so much method, e.g this.exchange.mutate().request(req).build(), req.mutate().header(key, map.get(key)) Could you please give me some help?

pavolloffay commented 5 years ago

I am more interested in integration test. There are some for webflux which should use this class.