First Experiences with OpenTracing and Zipkin on OpenPower Systems

OpenTracing is an open and vendor-neutral distributed tracing standard for applications. It allow developers to instrument their code in a vendor neutral way. Every component of a distributed system can be instrumented independently.

From the OpenTracing documentation:

“OpenTracing makes it easy for developers to add (or switch) tracing implementations with an O(1) configuration change. OpenTracing also offers a lingua franca for OSS instrumentation and platform-specific tracing helper libraries.”

If you are new to OpenTracing then the following link is a very good read: https://medium.com/opentracing/distributed-tracing-in-10-minutes-51b378ee40f1

The OpenTracing documentation is also a great source to dig deeper : http://opentracing.io/documentation/

I had a requirement to trace a multi-arch micro-services based application, where some of the services were on Ubuntu 16.04 PowerPC Little Endian (ppc64le) version.  OpenTracing with Zipkin was the selected combination since this was used on the Intel systems prior to migrating some of the services to Power architecture.  I was bit skeptical if it will work out-of-the box on Power architecture. My colleague Hemant Kumar who works on tracing had told me about his successful usage of OpenTracing and Zipkin on PowerPC architecture but I had my doubts. However, I was pleasantly surprised.  Everything worked out of the box.

In a nut shell, if you are using or planning to use OpenPower platform to run microservices, then the required building blocks for tracing are already available and immediately consumable.

I could have run the Zipkin collector on an Intel system, but ditched that thought and wanted to try the complete infrastructure on Power, which worked like a dream. Following are the steps to create Zipkin Docker image for PowerPC, and demonstration of few OpenTracing examples on OpenPower system.

Build a Docker Image for Zipkin

$ cat Dockerfile
FROM ppc64le/openjdk:8-jre
RUN wget -O /zipkin.jar 'https://search.maven.org/remote_content?g=io.zipkin.java&a=zipkin-server&v=LATEST&c=exec'
EXPOSE 9411
WORKDIR /
ENTRYPOINT ["java","-jar","/zipkin.jar"]

$ sudo docker build –t ppc64le/zipkin .

Run Zipkin
Run the Docker image built in the previous step to start the Zipkin collector and UI

$ sudo docker run -itd -p 9411:9411 ppc64le/zipkin

The zipkin UI is available at http://DOCKER_HOST_RUNNING_ZIPKIN:9411
If you want to run it standalone then you can just download the zipkin jar and execute it directly.

OpenTracing Examples

Run the following example as described in the OpenTracing site
Ensure GOPATH is set properly before you run the examples. The IP of the Docker host running the example code is 192.168.122.146

$ go get github.com/opentracing-contrib/examples/go
$ cd github.com/opentracing-contrib/examples/go
$ go run ./trivial.go 192.168.122.146
# Visualize the tracing instrumentation in Zipkin by
# clicking on "Find Traces" in the UI.

A more complex example is available in my github.

$ git clone --branch zipkin https://github.com/bpradipt/opentracing-example.git
$ cd opentracing-example
$ go build 
$ ./opentracing-example 192.168.122.146
Go to http://192.168.122.146:8080/home to start a request!

Open a web browser and go the above URI to start a request. Once the request has completed, open the zipkin UI to view the trace.
Following are the screenshots from my setup:

zipkin1

 

zipkin2

 

Pradipta Kumar Banerjee

I'm a Cloud and Linux/ OpenSource enthusiast, with 16 years of industry experience at IBM. You can find more details about me here - Linkedin

You may also like...