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
This example was ported from similar examples, such as Spring Boot.
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.
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
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
Once the services are started, open http://localhost:8081/
- This will call the backend (http://localhost:9000/api) and show the result, which defaults to a formatted date.
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