Skip to main content

Middleware for Django, Flask, and FastAPI to intercept requests, logs, and exceptions.

Project description

SF3 Middleware - Currently transmissions are diabled

Middleware for Python (Django, Flask, and FastAPI) to intercept requests, print statements, logs, and exceptions while persisting tracing.

Installation

Use Poetry to install:

poetry add sf-veritas

Usage

Django, etc

Switch the following:

python manage.py runserver 0.0.0.0:8000

To:

sf-veritas API-KEY python manage.py runserver 0.0.0.0:8000

TODO - Rename all Sailfish artifacts to Sailfish.ai

Network Hop Calculation Time

To evaluate the performance impact of this package, we benchmarked 1000 HTTP requests with and without the package enabled.

Configuration Mean (ms) Median (ms) Std Dev (ms)
✅ With Package 79.12 54.00 111.18
❌ Without Package 69.70 52.00 73.78

⚠️ Note: The package introduces a slight increase in mean response time and variance. This trade-off may be acceptable depending on the value the package provides (e.g., additional logging, monitoring, or security features).


Optimized Entrypoint Capture (Post-Refactor)

After optimizing how the user-code entrypoint is captured (via faster stack inspection), we observed improved stability and performance across 1015 analyzed requests:

Configuration Mean (ms) Median (ms) Std Dev (ms)
✅ With Package 142.45 138.50 80.78
❌ Without Package 131.07 127.00 35.75

⚠️ The optimized implementation added a slight increase in mean latency (~8.7%), but this tradeoff is offset by improved accuracy of entrypoint capture.


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

sf_veritas-0.9.7.tar.gz (70.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sf_veritas-0.9.7-py3-none-any.whl (108.3 kB view details)

Uploaded Python 3

File details

Details for the file sf_veritas-0.9.7.tar.gz.

File metadata

  • Download URL: sf_veritas-0.9.7.tar.gz
  • Upload date:
  • Size: 70.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.6.56+

File hashes

Hashes for sf_veritas-0.9.7.tar.gz
Algorithm Hash digest
SHA256 11c85b91442a79354cc856f789677a500dc6ee21c4bc5375be1ee12211988c78
MD5 c1daab06cde8f8e6bbcca0dadb87fc17
BLAKE2b-256 4a5aa193a645fc9a8929d3ed07c05f7cc25f648c829cfe6435cdec4070b7dd9d

See more details on using hashes here.

File details

Details for the file sf_veritas-0.9.7-py3-none-any.whl.

File metadata

  • Download URL: sf_veritas-0.9.7-py3-none-any.whl
  • Upload date:
  • Size: 108.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.6.56+

File hashes

Hashes for sf_veritas-0.9.7-py3-none-any.whl
Algorithm Hash digest
SHA256 413a0108b5e4d05a7878670e16ea1acbe57ef5e8d61853446f0875b5759f4159
MD5 49cac385b2143056171772ec76ea5837
BLAKE2b-256 09d3ec9c58c0a885494674b5f6e7218596a0582905a6342c6a67da6d91f1fb34

See more details on using hashes here.

Supported by

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