Skip to main content

AI-powered error monitoring for Python applications: automatic error reporting, breadcrumb tracking, and intelligent error grouping.

Project description

oluso-py

AI-powered error monitoring for Python applications: automatic error reporting, breadcrumb tracking, and intelligent error grouping.

Installation

pip install oluso

# With a framework integration
pip install "oluso[flask]"

Usage with Flask

from flask import Flask
from oluso import Oluso, Options
from oluso.integrations.flask import init_app

app = Flask(__name__)

client = Oluso(Options(api_key="your-api-key", environment="production"))
init_app(app, client)

@app.route("/")
def index():
    raise RuntimeError("something went wrong")  # captured and reported automatically

init_app wraps app.wsgi_app, so it works with any WSGI application, not just Flask. It scopes breadcrumbs to each request, auto-reports unhandled exceptions and 5xx responses, then re-raises so Flask/Werkzeug's own error handling still runs — Oluso only observes and reports, it never changes how your app responds to errors.

Breadcrumbs & User Context

Breadcrumbs and user context are scoped per request using contextvars — Python's idiomatic equivalent of the AsyncLocalStorage-based scoping the Node SDK uses (and Go's context.Context), correctly isolated per thread and per asyncio task:

from oluso import add_breadcrumb, set_user

@app.route("/checkout")
def checkout():
    add_breadcrumb("user started checkout", category="action")
    set_user(UserContext(id="user_456"))

    try:
        do_checkout()
    except Exception as err:
        client.capture_exception(err, {"cartId": "cart_123"})

For non-request work (a background job, a CLI command) where you still want a scope, open one yourself:

from oluso import scope, add_breadcrumb

with scope():
    add_breadcrumb("job started")
    client.capture_exception(err)

Manual Reporting

client.capture_exception(err, {"customMeta": "extra-info"})

Advanced Configuration

from oluso import Oluso, Options, Severity

client = Oluso(Options(
    api_key="your-api-key",
    endpoint="https://api.oluso.dev/api/v1/error/report",  # override for self-hosting
    environment="staging",
    default_severity=Severity.MEDIUM,
    max_breadcrumbs=50,
    max_errors_per_minute=100,
    sensitive_keys=["ssn", "internal_id"],
    should_report=lambda err: "expected" not in str(err),
))

Call client.flush(timeout=5) before your process exits so a capture right before shutdown isn't lost.

Error Report Structure

Reports sent to the API include:

  • Metadata: Title, message, stack trace, severity, tags.
  • Context: Request details (URL, method, headers, etc.), server details (hostname, Python version, memory, thread count).
  • History: Breadcrumbs leading up to the error.
  • Identification: Fingerprint for deduplication and user ID.

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

oluso-1.0.0.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

oluso-1.0.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oluso-1.0.0.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for oluso-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a5096bee379c037a932c5abf49fc18b67a01920d91a3d37b374c9ace9f1bbff0
MD5 ddd7beccfe1427e2a1f2dff3453ee2ac
BLAKE2b-256 3de82cd78b9996c3c60086be7c1ae37f1240b3eef471715d6457ec9d8ae05e92

See more details on using hashes here.

File details

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

File metadata

  • Download URL: oluso-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for oluso-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05d772dec3540b9c64025f44190af31835b1278db3ef6957a339f9612647036a
MD5 16565c6b593a5c6832482623a170d88e
BLAKE2b-256 c078a1c28ae87cac5a1246cd1baefb35e638f2009828871f8002be83ae2fd557

See more details on using hashes here.

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