Search code examples
springspring-bootspring-cloud-sleuth

Spring cloud slueth SpanAccessor interface


I am inject SpanAccessor interface from Spring Cloud Slueth, the version I am using is 1.3.3, I want to upgrade to version 2.1.1 where that interface is removed. There is no documentation on what alternate I can use to get this of the SpanAccessor I am using. any ideas on how to go around this issue?

this what I am currently doing:

@Inject
private SpanAccessor spanAccessor;

and then using it like this:

spanAccessor.getCurrentSpan().toString().split(",");

No documentation available to refactor this to something that can give me current span.


Solution

  • You can inject and use SpanCustomizer interface to customize the current span (add tags / logs etc.) or inject and use Tracing to retrieve the current span ad manipulate it.