How to Trace APIs with Jaeger-Opentracing?

Tudip Technologies
2 min readOct 25, 2021

“If you don’t have a microscope, you can’t see bacteria; and if you don’t have a telescope, you can’t see Jupiter. Jaeger is like that — both the big picture and the fine-grained details at the same time.”

Jaeger, inspired by Dapper and OpenZipkin, is a distributed tracing system released as an open-source by Uber Technologies. It is used for monitoring and troubleshooting microservices-based distributed systems.

Before delving into the core technical part, let’s simplify some terms.

Opentracing:

Opentracing is a hot topic for discussion among the developer community. In the course of this blog, we will know what jaeger-open tracing all about is and why it is needed?

OpenTracing is an approach to enable reusable and vendor-neutral instrumentation for distributed tracing systems.

Here are some basic terminologies of Opentracing:

  • Span: It is a logical unit of work with details like operation name, starts time and duration to complete that work.
  • Trace: It is simply a collection of spans belonging to the same service and sharing a common traceId. A single trace represents the vapour trail left behind by a request after it propagates through a distributed system. It gives you information about any HTTP requests, database calls. It is an useful tool for understanding the flow of application traffic and to spot any bottlenecks across a suite of micro services.

Next, we will learn about how distributed tracing system jaeger troubleshoots micro-service-based applications.

In microservice architecture where millions of intervened services work together, it’s almost impossible to identify interdependencies of these services and the execution pattern of HTTP requests. Even matrices and loggers cannot produce a depth overview of the system and adversely increases the system storage and affects system performance. A logging system (see Fig. 2) spreading out tons of similar statements does not help developers quickly find a root cause.

Fig. 2

Here we need some better tools to get an in-depth understanding of microservice execution patterns and details like latency and slow queries.

Enough of theory, let move ahead and do some hands-on.

Read more: https://tudip.com/blog-post/how-to-trace-apis-with-jaeger-opentracing/

--

--