Nitul
Nitul

Reputation: 1035

Run time tracing method execution - spring-cloud-sleuth provides

spring-cloud-sleuth provides way to trace method execution with @NewSpan

As it is annotation it is not feasible to add annotation on all methods of project.

Also, in production environment we only need to trace the method execution time once we find latency in execution.

Is there any way to enable tracing for Method calls at run time without restarting application?

Upvotes: 0

Views: 626

Answers (1)

Marcin Grzejszczak
Marcin Grzejszczak

Reputation: 11149

Nothing comes out of the box for such an approach. What you can do though, is to register your own implementation of the SpanReporter. In that implementation, you could retrieve the duration for a Span and then, depending on its value, either send it to Zipkin or not (or do something else about it).

Upvotes: 1

Related Questions