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

Add onCreate callback to WebFluxSpanDecorator

Open NHebrard opened this issue 4 years ago • 3 comments

Hello!

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

Thanks, @geoand.

NHebrard avatar Jan 04 '21 10:01 NHebrard

@csabakos wanna take a look as well?

geoand avatar Jan 04 '21 10:01 geoand

@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 avatar Jan 04 '21 19:01 csabakos

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

kkrawczy avatar Feb 15 '21 17:02 kkrawczy