Skip to main content

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


Download files

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

Source Distribution

landregistry_trace_id-0.9.9.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

landregistry_trace_id-0.9.9-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file landregistry_trace_id-0.9.9.tar.gz.

File metadata

  • Download URL: landregistry_trace_id-0.9.9.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for landregistry_trace_id-0.9.9.tar.gz
Algorithm Hash digest
SHA256 bdd68f792d824c9fe8e914e7cf3ee8f5a435db0ad871124624a69b6eea6c276d
MD5 5608b06669d9475f74ab4ccc54bc0a9e
BLAKE2b-256 229812249383d4092f3d5e3ba120bb53a36ed5ea63a1d1dc1582e251327fc134

See more details on using hashes here.

File details

Details for the file landregistry_trace_id-0.9.9-py3-none-any.whl.

File metadata

File hashes

Hashes for landregistry_trace_id-0.9.9-py3-none-any.whl
Algorithm Hash digest
SHA256 84960f02886594af9fe2e3b5a097abd1df78506d79c83c77a13ec9216350789f
MD5 299d709734dabf4d3c0a59ef4f6ff4b7
BLAKE2b-256 bdaf9603268f1190da89f83b753caad3df2a35ec7c4dc51263ac4d23c857cd6e

See more details on using hashes here.

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