Skip to main content

Correlation IDs in Django for debugging requests

Project description

https://travis-ci.org/snowball-digital/cid.png?branch=master https://coveralls.io/repos/snowball-digital/cid/badge.png?branch=master

Logging is important. Anyone who has had a call at 3am to say the site is down knows this. Without quality logging it is almost impossible to work out what on earth is happening.

Even with plenty of logs it can be hard to track down exactly what the effects of a particular request are. Enter Django Correlation IDs. The approach is quite a simple one. Incoming requests are assigned a unique id (a uuid). This can either happen in say your public facing web server (e.g. nginx) or be applied as soon as it hits django.

This cid is then available throught the django request/response cycle. We provide filters for logging witch adds the cid to the logging record so you can add it to your formatting string. We also provide wrappers around all the standard database backends which adds the cid as a comment before each SQL request.

Features

  • Processing/Generation of a correlation id

  • Database wrappers to add correlation id to each sql call

  • Logging filter to inject the correlation id into logs

  • A template context processe to make correlation id available in templates

  • Output correlation id as a header

Documentation can be found at: http://django-correlation-id.readthedocs.org/

History

0.1.0 (2014-08-05)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-cid-0.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

django_cid-0.1.1-py2.py3-none-any.whl (8.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-cid-0.1.1.tar.gz.

File metadata

  • Download URL: django-cid-0.1.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-cid-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dc7ffe448d914aa892b5aab8fa86422852b908029ba97e533d7d05f260906e0b
MD5 381eb9b8ce90daca010ae747ae2b8d0b
BLAKE2b-256 09dca418ab11d716ee444cd30553c9e6372ff43bb9b602d69280eee0c841c7d0

See more details on using hashes here.

Provenance

File details

Details for the file django_cid-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_cid-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d886282491870b6dabba231d7299c7b6e3153f9a415ca779be19ee4f572981e0
MD5 68893dae721e40d60349bb0bac945216
BLAKE2b-256 ac67452500c182aea5a12520607fa229b0dfbe75b834d5fa76a555794cbad0a4

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page