Instrumenting your Go distributed application for tracing with Jaeger

Carlos Eduardo
8 min readOct 7, 2019

Recently I've been reading about application observation and got fascinated with Jaeger Tracing and the benefits tracing brings to visualize your data flow.

For deeper understanding, I recommend the book Mastering Distributed Tracing by Yuri Shkuro, an engineer at Uber, creator of Jaeger. He wrote a great tutorial on tracing and optimizing an application so here I’ll mostly focus how to basically instrument your Go application for tracing.

Since I was already playing with Echo, a nice and minimalist web framework for Go I decided to use it together with other tools to create some sample applications. I also contributed a tracing middleware and submitted a Prometheus Metrics middleware as well, waiting to be merged.

The example is composed of 3 “microservices”. The first is a Formatter, taking a name and returning a “Hello [Name]” string. The second, Publisher, just receives a string, calls the Echo microservice and prints the string to the console. The base of these two came from Yuri’s own tutorial repo and uses Go standard lib and a tracing library that provides some methods to make one’s life easier that I will detail later.

The third is a server created with Echo Framework, and the middleware to provide tracing that can be found it on the…

--

--

Carlos Eduardo
Carlos Eduardo

Written by Carlos Eduardo

Writing everything cloud and all the tech behind it. If you like my projects and would like to support me, check my Patreon on https://www.patreon.com/carlosedp

No responses yet