user1542639
user1542639

Reputation: 597

Is zipkin suitable for tracing method invocation?

I read about zipkin, but from my understanding, zipkin is suitable for tracking history of network requests and time (via Finagle). However, is it possible for me to use zipkin to track java method invocation time and location? For example, I want to track how long it takes for foobar() to execute, and what are other methods internally called by foobar() and its execution time and so on.

Upvotes: 5

Views: 2572

Answers (3)

Jonathan
Jonathan

Reputation: 20375

It's not suitable, Zipkin is about tracing in distributed systems. I would say you would want something like a profiler, such as Visual VM, - free and included with the JDK, or YourKit. Other profilers are available.

Upvotes: 1

Robert Christian
Robert Christian

Reputation: 18310

Zipkin is foremost intended to provide observability into a complex distributed network of services (aka Microservice Architecture). It wasn't intended to support just a single application.

So a profiler can often be a better way to go, particularly if you have an urgent issue to diagnose.

That said, most profilers will only provide realtime data, where Zipkin persists, allowing for analysis over large datasets.

If Zipkin is already in your stack, it's not a bad idea to enrich higher level Zipkin spans (ie a complete REST requests) with specific method calls as child-spans, particularly those that do I/O. This way you can drill down within Zipkin to more quickly determine bottlenecks.

Otherwise you'd have to first look at the Zipkin span for high-level bottlenecks, then separately look at other logs or run a profiler, which is inefficient.

** If it's already in your stack **

Upvotes: 1

om-nom-nom
om-nom-nom

Reputation: 62835

No, it is not suitable at all. Why? Because the architecture of Zipkin have multiple levels of indirection: you have to send your spans into collector service and even if collector is running on your own machine there is a huge overhead -- imagine you are traveling from two neighbour cities somewhere in Europe and somebody proposes you instead of going directly from A to B, fly from A to New York, USA and back to B. That is simply ridiculous.

As for the tools that may suit your needs: VisualVM and Yourkit mentioned by @Jonathan are good for looking at average situation in your program -- if you need to carefully inspect low level paths in your program InTrace might be a better choice.

Upvotes: 1

Related Questions