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:
- OpenTracing Specification
- OpenTracing Semantic Conventions
- OpenTracing API for Python
This tutorial is inspired by Yurishkuro's OpenTracing Tutorial
Additional Resources
- OpenTracing Documentation
- OpenTracing Blog on Medium
- OpenTracing API on GitHub
If you've ideas or suggestions for improving the lesson01 or the lesson01 needs
corrections, please create an issue or make a PR here

Steps
OpenTracing Python Tutorial - Lesson 01
Quick Hello World Example
Let's write a simple python program to print "Hello, arg
!", wherearg
is a command line argument to the program.
Click the below link to open hello.py
in the editor.exercise/hello.py
The file is located at/root/opentracing-tutorial/python/lesson01/exercise
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[1] say_hello(hello_to)
We run the above program with an argument, say Alice
,python2.7 hello.py Alice
We should see the output as:Hello, Alice!
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.