opentracing-contrib / java-spring-web

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

Add onCreate callback to WebFluxSpanDecorator #141

Open NHebrard opened 3 years ago

NHebrard commented 3 years ago

Hello!

With this PR, WebFluxSpanDecorator will be extended with an onCreate() callback called right after the span creation. Cf this issue: #140

Thanks, @geoand.

geoand commented 3 years ago

@csabakos wanna take a look as well?

csabakos commented 3 years ago

@csabakos wanna take a look as well?

The change LGTM but it would be good to understand a bit more about the use case to be able to say whether the change is really necessary or not. For example, why isn't the baggage getting extracted from the incoming HTTP headers or the parent span?

kkrawczy commented 3 years ago

@csabakos The use case would be to add to the baggage custom items that are not present in the incoming HTTP headers. WebFluxSpanDecorator sounds like a good component that could do it, but there is one problem. During span activation, we put baggage values into MDC, so if WebFluxSpanDecorator operates after activation we miss the values that we want to inject.