OpenTracing is a single, vendor-neutral, standard mechanism to describe the
behaviour of our distributed systems. It allows developers of application code,
OSS packages and OSS services to instrument their own code.
Before diving into the tutorial, ensure you are familiar with:
This tutorial is inspired by Yurishkuro's OpenTracing Tutorial
OpenTracing Python Tutorial - Lesson 01
Quick Hello World Example
Let's write a simple python program to print "Hello,
arg is a command line argument to the program.
Click the below link to open
hello.py in the editor.
The file is located at
Once the file is opened in the editor, you may copy the below content
into the file (or use the
Copy to Editor button):
# simple hello world program import sys def say_hello(hello_to): hello_str = 'Hello, %s!' % hello_to print hello_str assert len(sys.argv) == 2 hello_to = sys.argv say_hello(hello_to)
We run the above program with an argument, say
python2.7 hello.py Alice
We should see the output as:
Let's instrument the above code to illustrate the features of
OpenTracing (an opensource standard for distributed tracing) using
Jaeger (an opensource distributed tracing system). You may also use other
tracing systems, such as, Zipkin, LightStep etc.