Skip to content

openzipkin/pyramid_zipkin-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic example showing distributed tracing across python apps

This is an example app where two pyramid (python) services collaborate on an http request. Notably, timing of these requests are recorded into Zipkin, a distributed tracing system. This allows you to see the how long the whole operation took, as well how much time was spent in each service.

Here's an example of what it looks like zipkin screen shot

This example was ported from similar examples, such as Spring Boot.

Implementation Overview

Web requests are served by Pyramid routes, and tracing is automatically performed for you by pyramid_zipkin.

This example has two services: frontend and backend. They both report trace data to zipkin. To setup the demo, you need to start frontend.py, backend.py and Zipkin.

Setup

Before you start anything, you'll need to download the libraries used in this demo:

# get the latest version of pyramid_zipkin
$ pip install pyramid_zipkin -U
# install the example
$ python setup.py install

You'll also want to download zipkin.

$ curl -sSL https://zipkin.io/quickstart.sh | bash -s

Starting the Services

In a separate tab or window, start each of frontend.py and backend.py:

$ python frontend.py
$ python backend.py

Next, run Zipkin, which stores and queries traces reported by and above services.

$ java -jar zipkin.jar

Running the example

Once the services are started, open http://localhost:8081/

Now, you can view traces that went through the frontend via http://localhost:9411/?serviceName=frontend

  • This is a locally run zipkin service which keeps traces in memory

About

See how much time python services spend on an http request

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages