Giter Site home page Giter Site logo

tracing_flask_zipkin's Introduction

About:

This repo contains a demo of how to trace requests from Flask APIs using Zipkin.

Run the demo

Start The Containers:

To start the containers run the following command:

docker-compose up --build

Visit the api_01's URL [ http://localhost:5001 ]

The request flow:

As shown in the following image, api_01 will send two requests, one to api_02 and the other to api_03. api_02 will send a request to api_03.

To see this on Zipkin, visit Zipkin's URL [ http://localhost:9411/zipkin ] then click on the search button to get traces saved.

Select a trace from the list.

The request's trace.As you can see from the previous image, api_01 made 2 requests 'to api_02 and api_03'. Also, api_02 made a request to 'api_03' Each row here represents a span. You can create spans whenever it is needed.

Used Tools

Zipkin

Zipkin is a distributed tracing system. Using Zipkin will make you able to see all the services that a request goes through, determine the duration time needed for each service.

What is a distributed tracing system:

From OpenTracing website: Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially those built using a microservices architecture. Distributed tracing helps pinpoint where failures occur and what causes poor performance.

Flask

Flask is a lightweight WSGI framework. It is one of the most popular Python frameworks. Here is their documentation.

py_zipkin

py_zipkin provides a context manager/decorator along with some utilities to facilitate the usage of Zipkin in Python applications.  You can read more about it here

We use py_zipkin here as the application is a Python app. If you are interested in other languages, you can find a list of supported tracers by Zipkin here

Docker Compose

Docker Compose is a tool that you can use to define and run multi docker containers. You use a YAML file to define all services and with just one command you can start them all. To learn more about Compose, see their documentation.

tracing_flask_zipkin's People

Contributors

mohamedmsaeed avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.