Tracability for HMLR applications
Project description
Tracability for Python applications
Convienience Flask extension for retrieving trace IDs from incoming requests.
This package depends on:
- Flask (Version 2.2.2 or higher)
- Python 3.9 or higher
Usage
Instantiate it like a normal flask extension:
from landregistry.trace_id import TraceID
from <somewhere> import app
# ...
trace_id_extn = TraceID()
trace_id_extn.init_app(app)
# retrieve the current trace ID
trace_id = trace_id_extn.current_trace_id
Properties
TraceID.current_trace_id
If the application is serving a request, and the value in the request header X-Trace-ID
is present and is a valid trace ID, then returns the header value.
If the application is serving a request, and the request header X-Trace-ID
is absent or contains an invalid trace ID, returns a new trace ID. A new trace ID generated this way will be the same for all calls to current_trace_id for a given request.
If the application is not serving a request, returns N/A
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for landregistry-trace-id-2.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec12b41e41554139f156fcfa74a345655eb56f71cfea09bbf59f28012de6626c |
|
MD5 | 7387aefd9d265e917727cc071c91aafa |
|
BLAKE2b-256 | 5faa06695502b1de6550508fc3aff7e25599cc51bb3af5eba4d4fb7e4a0cf8f3 |
Hashes for landregistry_trace_id-2.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecda62b5766101fa007c49a64bd3762f8a3e47d01a3aa7613a4d206e1ed442e9 |
|
MD5 | 5356842a774c49de338f6b918c7b7eef |
|
BLAKE2b-256 | 279363fd40a163fa533ee34179b1a384eb3c8219c1b98ca3b02702ac43773bbf |