Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Stuff to correlate requests, logs, and the like

Project Description

This sprocket provides a single mix-in that imbues your RequestHandler with a unique correlation ID. If a correlation ID is present upon input then it will be preserved in the output. It is also available for your use as the correlation_id property.


sprockets.mixins.correlation is available on the Python Package Index and can be installed via pip:

$ pip install sprockets.mixins.correlation


from sprockets.mixins import correlation
from tornado import ioloop, web

class Handler(correlation.HandlerMixin, web.RequestHandler):
   def get(self):
      self.finish('my id is {0}'.format(self.correlation_id)

if __name__ == '__main__':
   application = web.Application([('/', Handler)])

Generated Correlation ID

GET / HTTP/1.1
Host: localhost:8888
Connection: keep-alive
HTTP/1.1 200 OK
Correlation-ID: 0a2b6080-e4da-43bf-a2a5-38d861846cb9
Content-Length: 44

my id is 0a2b6080-e4da-43bf-a2a5-38d861846cb9

Relayed Correlation ID

GET / HTTP/1.1
Host: localhost:8888
Connection: keep-alive
Correlation-Id: 4676922073c4c59b1f5e6b4a18894bd46f867316
HTTP/1.1 200 OK
Correlation-ID: 4676922073c4c59b1f5e6b4a18894bd46f867316
Connection: close
Content-Length: 48

my id is 4676922073c4c59b1f5e6b4a18894bd46f867316
Release History

Release History

This version
History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
sprockets.mixins.correlation-1.0.1-py2.py3-none-any.whl (8.8 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Mar 31, 2015
sprockets.mixins.correlation-1.0.1.tar.gz (6.5 kB) Copy SHA256 Checksum SHA256 Source Mar 31, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting