Giter Site home page Giter Site logo

django-zipkin-trace's Introduction

Django-zipkin-trace

DEPRECATED: Please use opencensus-python for a replacement

License PyPi

Automatically trace your Django application with py_zipkin

Screenshot

Trace running in Zipkin:

Zipkin

Trace running in Stackdriver Trace using Zipkin adapter:

Stackdriver Trace

Stackdriver Trace Analysis

Installation

Install this from pip:

$ pip install django-zipkin-trace

(you may want to write this in your requirements.txt)

Then add zipkin_trace.ZipkinMiddleware as your topmost middleware and set ZIPKIN_SERVER to your Zipkin URL (eg. http://zipkin:9411)

Supported tracers

These tracers are provided out of the box. No configuration is needed.

  • Database query (SQL are logged, but parameters are not)
  • urllib3 requests (including the requests module)
  • Template rendering

Configuration options

These options can be set in settings.py:

  • ZIPKIN_SERVER: HTTP URL of Zipkin server
  • ZIPKIN_SERVICE_NAME: Service name, default to Django
  • ZIPKIN_SAMPLE_RATE: Sampling rate in percent from 0 - 100, default to 100

Overriding transport

If you use other Zipkin transport, override transport_handler(self, span) in zipkin_trace.ZipkinMiddleware to your transport code. See py_zipkin docs for example.

By default, py_zipkin will batch 100 traces before sending. This will make traces slow to appear in Zipkin as it needs to collect 100 traces first. If Django debug mode is on, the middleware will disable this buffer.

Support policy

This library will be deprecated once opentracing-python ships a Zipkin-compatible tracer.

License

Licensed under the MIT License. Contains code adapted from django-speedbar.

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.