Skip to main content
Web frameworks catch your exceptions and turn them into 500 responses before sys.excepthook ever sees them. That’s exactly the failure mode slomo’s auto-tracing solves: the exception is recorded the moment it escapes your handler function, before the framework swallows it — with arguments, locals, and the SQL/HTTP calls that led up to it. The integration for every framework is the same line:

FastAPI

Call enable() at import time of your app module (before the routes run). With multiple workers (uvicorn/gunicorn), each worker process records its own session — forked children are labeled forked_from in their metadata. A 500 in the checkout route lands in slomo issues like any crash: fingerprinted, classified, with the route function’s args (sku), its locals, and any database or HTTP activity from the request.
The repository’s examples/fastapi_app.py is a complete runnable app showing lifespan integration, tracked async routes, per-request middleware events, and background-task failures.

Flask

Same story: view functions are project code, so they’re auto-traced; escaping exceptions are recorded before Flask converts them to error responses. See examples/flask_app.py.

Per-request context

Two useful patterns for request-scoped visibility:
Custom events make slomo timeline read like an access log interleaved with your traces, and slomo search path=/checkout finds every request to a route.

Diagnosing a production-shaped 500

Live-tailing during development

Run your dev server in one terminal and follow the recording in another:
Every request, query, and warning streams by as it happens — a structured alternative to print debugging that you can search afterwards.