Skip to main content

Monitoring, performance and security SDK for Python applications

Project description

ShieldPress

shieldpress-tracker for Python

Monitoring, performance and application-security telemetry for Python 3.8+ with no required third-party dependencies.

Dashboard: https://shieldpress.net/

Install

pip install shieldpress-tracker

Quick start

from shieldpress_tracker import ShieldPress

tracker = ShieldPress.init(
    api_key="YOUR_SHIELDPRESS_API_KEY",
    site_id="auto",
    app_name="my-python-app",
)

Configuration can also use SHIELDPRESS_API_KEY, SHIELDPRESS_SITE_ID, SHIELDPRESS_API_URL, SHIELDPRESS_APP_NAME and SHIELDPRESS_APP_VERSION environment variables.

Flask / WSGI

from flask import Flask
from shieldpress_tracker import ShieldPress

app = Flask(__name__)
tracker = ShieldPress.init(api_key="...", site_id="auto", app_name="flask-app")
app.wsgi_app = tracker.middleware(app.wsgi_app)

Django

Wrap the WSGI application in wsgi.py:

from shieldpress_tracker import ShieldPress

application = ShieldPress.instance().middleware(application)

Manual instrumentation

tracker.record_request("/orders", "POST", 201, 42.5)
tracker.capture_error(ValueError("Invalid order"), {"order_id": 123})
tracker.analyze_request("/login", "POST", headers, body, ip="203.0.113.2")
tracker.record_auth_failure(ip="203.0.113.2", url="/login", reason="bad password")
tracker.record_rate_limit(ip="203.0.113.2", url="/api")
tracker.record_cors_violation(ip="203.0.113.2", origin="https://untrusted.example", url="/api")
tracker.flush()
tracker.stop()

Options use snake_case: api_url, report_interval, system_metrics, http_tracking, error_tracking, security_tracking, dep_audit, dep_audit_interval, runtime_metrics, env_security, heartbeat, app_version, environment, tags, ignore_paths, max_error_buffer, max_security_buffer, and debug.

The SDK never raises a network/reporting failure into the host application. Reports are sent to /api/tracker/report with Bearer authentication.

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

shieldpress_tracker-1.0.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

shieldpress_tracker-1.0.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file shieldpress_tracker-1.0.0.tar.gz.

File metadata

  • Download URL: shieldpress_tracker-1.0.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shieldpress_tracker-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cb017fa195fb4a0f9b70b615596cef80b2e688fb3a28dcf99528becb899a9391
MD5 e44b8dedbd101af0f04593d82998652f
BLAKE2b-256 e1635ace780d42197134e10a7ed87b609caacc4d7baf47263e785540cb49a59f

See more details on using hashes here.

Provenance

The following attestation bundles were made for shieldpress_tracker-1.0.0.tar.gz:

Publisher: publish-python.yml on vithanhlam/ShieldPress-Tracker-Python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shieldpress_tracker-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for shieldpress_tracker-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2357cd385fe11a9ac5155eba2e2aa6fc865bf3eb14b3a23f444ea84b092ef653
MD5 3f154083c1b5a4cd30d3906238be7201
BLAKE2b-256 881b2f5618ab280ae49aa630e10f6f35cb56468bc131c19e1883fcb7476d9b91

See more details on using hashes here.

Provenance

The following attestation bundles were made for shieldpress_tracker-1.0.0-py3-none-any.whl:

Publisher: publish-python.yml on vithanhlam/ShieldPress-Tracker-Python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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