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.
Metadata
Release files for realuptime-errors 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| realuptime_errors-0.4.0.tar.gz | 19.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| realuptime_errors-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.4 kB
Release files / realuptime_errors-0.4.0.tar.gz
| Download URL | realuptime_errors-0.4.0.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b010868a694735fdf067c63666797b54b37d3740ad7f65d6e9fe12d91be2e3cb
|
|
BLAKE2b-256 checksum How to use checksums |
dea8a9fea3c9e1a0ef1f73b0016ecb76fe59cf55770d8847d9b89e324d7ae35e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.1
|
Release files / realuptime_errors-0.4.0-py3-none-any.whl
| Download URL | realuptime_errors-0.4.0-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06bfcdc0ae9ab4ebc97ae51a549b9b90e5fada2dae3372fc94653f95b2be5749
|
|
BLAKE2b-256 checksum How to use checksums |
133c2e5c9eb0001da05e749d6d187a7253bf0bfd7a307f03efb45417684e8ad4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.1
|