java-spring-web
java-spring-web copied to clipboard
Add onCreate callback to WebFluxSpanDecorator
Hello!
With this PR, WebFluxSpanDecorator will be extended with an onCreate() callback called right after the span creation.
Cf this issue: #140
Thanks, @geoand.
@csabakos wanna take a look as well?
@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?
@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.