realuptime-errors
Zero-dependency error tracking SDK for Python (WSGI/ASGI middleware plus manual capture): part of RealUptime Errors.
This is a mirror. It is published from packages/errors-py in the
realuptime monorepo by
scripts/publish-sdk-mirrors.mjs and is not edited directly; open issues
and PRs against this repo, but expect source changes to land here after
they merge upstream.
Install
Installable from the package registry (primary) or straight from this mirror's git history (e.g. to pin an exact commit).
pip install realuptime-errors
# or, straight from this mirror
pip install "git+https://github.com/RealUptimeHQ/realuptime-errors-py"
Usage
import realuptime_errors
realuptime_errors.init(
dsn="https://realuptime.io/api/errors/v1/ingest/rue_...", # from your project's dashboard
release="v2.4.1",
environment="production",
)
realuptime_errors.capture_exception(some_exception)
WSGI: app = realuptime_errors.WsgiMiddleware(app)
ASGI: app = realuptime_errors.AsgiMiddleware(app)
What this SDK actually does
- Never raises out of a public function. Every entry point catches
everything; a broken SDK logs once to stderr (prefixed
[realuptime-errors]) and goes quiet. An error tracker that crashes the app it watches is worse than none. - Scrubs PII by default, client-side, before anything serializes:
Authorization/Proxy-Authorization/Cookie/Set-Cookieheaders are replaced whole; card-shaped digit runs (Luhn-checked), JWTs, prefixed API keys, and long hex/base64 runs are pattern-scrubbed anywhere they appear in the message, request context, breadcrumbs, or captured source lines. Opt one field back in withallow_fields=["x-request-id"]; there is no global "disable scrubbing" switch, by design. - Never silently drops. The in-memory buffer (200 events) evicts the oldest event when full, counts every eviction, and reports the count on the next successful batch, so drops show up on your dashboard instead of disappearing.
- Standard library only. No third-party imports, ever, checked by a
test in this repo (
tests/test_wire_contract.py) that scans the source for anything outside an explicit allow-list.
API
| Function | Notes |
|---|---|
init(dsn, release=None, environment=None, allow_fields=None, capture_unhandled=True) |
Installs a sys.excepthook for unhandled exceptions unless capture_unhandled=False. Safe to call twice; a missing DSN logs once and stays inert. |
capture_exception(exc, request=None, fingerprint=None, release=None, environment=None) |
Reports an exception. |
capture_message(message, ...) |
Reports a plain message. |
add_breadcrumb(message, category=None, data=None) |
Bounded trail (last 20), rides the next event. |
flush() |
Delivers anything buffered. |
WsgiMiddleware(app) / AsgiMiddleware(app) |
Captures unhandled exceptions with minimal request context (method, path), then re-raises. |
Version
This mirror tracks SDK_VERSION 0.4.0 in realuptime_errors.py, the
string every event actually carries on the wire.
License
MIT, see LICENSE.
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 realuptime_errors-0.4.0.tar.gz.
File metadata
- Download URL: realuptime_errors-0.4.0.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b010868a694735fdf067c63666797b54b37d3740ad7f65d6e9fe12d91be2e3cb
|
|
| MD5 |
f67a4704ee703bf1e03914c541d4dfd5
|
|
| BLAKE2b-256 |
dea8a9fea3c9e1a0ef1f73b0016ecb76fe59cf55770d8847d9b89e324d7ae35e
|
File details
Details for the file realuptime_errors-0.4.0-py3-none-any.whl.
File metadata
- Download URL: realuptime_errors-0.4.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06bfcdc0ae9ab4ebc97ae51a549b9b90e5fada2dae3372fc94653f95b2be5749
|
|
| MD5 |
1bdbea7913fee30d1de06fe2fd067466
|
|
| BLAKE2b-256 |
133c2e5c9eb0001da05e749d6d187a7253bf0bfd7a307f03efb45417684e8ad4
|