I'm learning how to track my distributed processes through all the microservices. I've been playing with Sleuth, Zipkin and different microservices, and it works fantastic! But when I try to do the same in a project interacting between the different dependencies I can not create the same behavior.
This image show how currently is working different microservices.
This is the diagram of microservices:
And this image show how works an application with dependencies.
This is the diagram of application with dependencies:
I wonder, is it possible to create the same behavior using dependencies as with microservices?
Taking the input of @MarcinGrzejszczak as reference, I resolved using a custom span:
Span remoteDependency = tracer.nextSpan()
.name("dependency_name")
.start();
Where tracer
is an autowired object from Trace
:
@Autowired
private Tracer tracer;
Both classes are in brave
package
import brave.Span;
import brave.Tracer;
Result:
If you want to take a look at the implementation in more detail, here is the sample: https://github.com/juanca87/sample-traceability-microservices