Skip to main content

RuntimeScope SDK for Python — runtime profiling and telemetry for Django, Flask, FastAPI, and any Python app

Project description

runtimescope (Python)

Python SDK for RuntimeScope — runtime profiling and telemetry for Django, Flask, FastAPI, and any Python app.

pip install runtimescope

Zero required dependencies — the SDK uses only the Python standard library. Framework integrations (Django / Flask / FastAPI) are opt-in.

Quick Start

from runtimescope import RuntimeScope

RuntimeScope.connect(dsn="runtimescope://proj_xxx@localhost:6768/my-app")
# or set RUNTIMESCOPE_DSN in your environment and call with no args:
RuntimeScope.connect()

RuntimeScope.track("user_signed_up", {"plan": "pro"})
RuntimeScope.add_breadcrumb("task started", {"task_id": 42})

When RUNTIMESCOPE_DSN is not set, the SDK is completely inert — no connection attempts, no patching, zero overhead. Safe to ship to production.

Framework Integrations

Django

# settings.py
MIDDLEWARE = [
    "runtimescope.integrations.django.RuntimeScopeMiddleware",
    # ...
]

# Optional: set DSN via Django settings (otherwise uses RUNTIMESCOPE_DSN env var)
RUNTIMESCOPE_DSN = "runtimescope://proj_xxx@localhost:6768/my-django-app"

Flask

from flask import Flask
from runtimescope.integrations.flask import init_app

app = Flask(__name__)
init_app(app)  # reads RUNTIMESCOPE_DSN from env

FastAPI

from fastapi import FastAPI
from runtimescope.integrations.fastapi import RuntimeScopeMiddleware

app = FastAPI()
app.add_middleware(RuntimeScopeMiddleware)

What Gets Captured

Capture Default How
Every HTTP request ✅ via middleware method, URL, status, duration
Uncaught exceptions sys.excepthook hook
logging.WARNING+ Python logging handler
Custom events Manual RuntimeScope.track(name, properties)
Breadcrumbs Manual RuntimeScope.add_breadcrumb(msg, data)
Manual exception Manual RuntimeScope.capture_exception(exc)

You can disable the auto-captures via connect() kwargs:

RuntimeScope.connect(
    dsn="...",
    capture_errors=False,    # don't install sys.excepthook
    capture_logging=False,   # don't hook into `logging`
)

DSN Format

Same as every other RuntimeScope SDK:

runtimescope://proj_xxx@host:6768/app-name
runtimescopes://proj_xxx@runtimescope.example.com/app-name   # TLS

The HTTP port is canonical; the WebSocket port is derived as http_port - 1.

Auth Tokens

Pass auth_token="..." to connect() or set RUNTIMESCOPE_AUTH_TOKEN in the environment. The token is sent as a Bearer header on every POST.

License

MIT

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

runtimescope-0.10.1.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

runtimescope-0.10.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file runtimescope-0.10.1.tar.gz.

File metadata

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

File hashes

Hashes for runtimescope-0.10.1.tar.gz
Algorithm Hash digest
SHA256 2ba23c9ebc04e471ac304b826416731f4664bc2f2894aa41a3eb5228d02d4765
MD5 78d02996c9c8c84fc66d23fa81170d8b
BLAKE2b-256 183a6618cb8e2a2abf7c042cf3a5998a7730f53e98f41fac6e445ad3955efcf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for runtimescope-0.10.1.tar.gz:

Publisher: publish-pypi.yml on edwinlov3tt/runtimescope

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

File details

Details for the file runtimescope-0.10.1-py3-none-any.whl.

File metadata

  • Download URL: runtimescope-0.10.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for runtimescope-0.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 30bd472065a49742e2d6c6a9a566f7c10ae220816fd7b38b5791bc83de07b986
MD5 7f1d1433d37f26e1ae5ef5ea9265abb1
BLAKE2b-256 70b36e1b71bbdc8edb27176ae45d4e6ef6ad438558e8d5ee5950655ce5ac646c

See more details on using hashes here.

Provenance

The following attestation bundles were made for runtimescope-0.10.1-py3-none-any.whl:

Publisher: publish-pypi.yml on edwinlov3tt/runtimescope

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