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.10.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.10-py3-none-any.whl (108.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sf_veritas-0.9.10.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.10.tar.gz
Algorithm Hash digest
SHA256 b9d2704891823791163e1fc2ab580139ec84057b7591dfe17ce1a2d0bb966c56
MD5 c922a9aca9233a4e0853370ffe126601
BLAKE2b-256 04581cd7331167b8f3b7449547a98b618ca295c8a2a8dd697701beea469d12b1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sf_veritas-0.9.10-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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 b0552f13afcdecdc74fd06e8616c05a7dfe2c7e3ddc4636a79f9c38d86ac272f
MD5 fa2c67b2780a9e9230ee9c74cfd025f4
BLAKE2b-256 47acb1b7ac6cd6c7dd4a94fb2c40e8c17fc096148968a9411c57c9c2c13bb8c4

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