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.
Installation
sprockets.mixins.correlation is available on the Python Package Index and can be installed via pip:
$ pip install sprockets.mixins.correlation
Example
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)])
application.listen(8888)
ioloop.IOLoop.instance().start()
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 files for sprockets.mixins.correlation 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sprockets.mixins.correlation-3.0.0.tar.gz | 7.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sprockets.mixins.correlation-3.0.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 13.8 kB
Release files / sprockets.mixins.correlation-3.0.0.tar.gz
| Download URL | sprockets.mixins.correlation-3.0.0.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f13ad20b2b74b84656f526d14d75dad12a4672a7d2752511164c6dee8ca28def
|
|
BLAKE2b-256 checksum How to use checksums |
13f202aaf228dc9ef23ae6767dbb01d9c620ed69aa2eac2b254df19654b21d1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.7
|
Release files / sprockets.mixins.correlation-3.0.0-py2.py3-none-any.whl
| Download URL | sprockets.mixins.correlation-3.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
61d1455e4af80bf85f219d6135b5726d1eb45c42ca31ea7297255339d199e53c
|
|
BLAKE2b-256 checksum How to use checksums |
64e67e9ccead4fc94dd30db12dcf8d1ca6bc10e61e7e79f58c23d8abb1b6f64e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.7
|