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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file runtimescope-0.10.11.tar.gz.
File metadata
- Download URL: runtimescope-0.10.11.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
866708d4a1ffb0364aba025afc4adcd78c64d21ab1b8d4ee94e20d7fb87dcc43
|
|
| MD5 |
bd3e6b32f47b9217699b816ed55c2483
|
|
| BLAKE2b-256 |
02be888b50fbaa6cd8a1801197eff54f0afc2a258a4a1df52af9f7b2fe534f8e
|
Provenance
The following attestation bundles were made for runtimescope-0.10.11.tar.gz:
Publisher:
publish-pypi.yml on edwinlov3tt/runtimescope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
runtimescope-0.10.11.tar.gz -
Subject digest:
866708d4a1ffb0364aba025afc4adcd78c64d21ab1b8d4ee94e20d7fb87dcc43 - Sigstore transparency entry: 1624449992
- Sigstore integration time:
-
Permalink:
edwinlov3tt/runtimescope@7920f9e639b10239f2f47a3d47d46faf95485408 -
Branch / Tag:
refs/tags/v0.10.11 - Owner: https://github.com/edwinlov3tt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7920f9e639b10239f2f47a3d47d46faf95485408 -
Trigger Event:
push
-
Statement type:
File details
Details for the file runtimescope-0.10.11-py3-none-any.whl.
File metadata
- Download URL: runtimescope-0.10.11-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a52e34985e87c4c02b71deec74ab2774a0ae050cd99c2516db30ff654908d057
|
|
| MD5 |
f0f83c43e411f2737f7a597e74abd0fc
|
|
| BLAKE2b-256 |
c1a67ee01f1c889ad30dc5c2f1289d6f7265279f9e47179a3b8795621102b08c
|
Provenance
The following attestation bundles were made for runtimescope-0.10.11-py3-none-any.whl:
Publisher:
publish-pypi.yml on edwinlov3tt/runtimescope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
runtimescope-0.10.11-py3-none-any.whl -
Subject digest:
a52e34985e87c4c02b71deec74ab2774a0ae050cd99c2516db30ff654908d057 - Sigstore transparency entry: 1624450108
- Sigstore integration time:
-
Permalink:
edwinlov3tt/runtimescope@7920f9e639b10239f2f47a3d47d46faf95485408 -
Branch / Tag:
refs/tags/v0.10.11 - Owner: https://github.com/edwinlov3tt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7920f9e639b10239f2f47a3d47d46faf95485408 -
Trigger Event:
push
-
Statement type: