← All platforms

Litestar error tracking

Typed handlers help you build the API. Error reports help when it breaks. Use the Sentry Litestar integration to keep those reports on your Telebugs server.

~/hoofnotes  pip install sentry-sdk
~/hoofnotes  nvim app.py
import sentry_sdk
sentry_sdk.init(
# Copy the complete Telebugs DSN, key and path included.
dsn="YOUR_TELEBUGS_DSN",
)
from hoofnotes.api import app
~/hoofnotes  uvicorn app:app

Space pauses or resumes. R replays. Escape shows the complete setup.

Hang on, I already use Sentry

Keep sentry-sdk and change its destination to your Telebugs DSN. Your error reports stay on your server. You don’t need a Sentry account.

Does this understand Litestar handlers?

Yes. The Python SDK has a Litestar integration for request exceptions. It can attach request context to the backtrace, including errors from async handlers.

What about an error I handle myself?

It can still be worth investigating. Send it with sentry_sdk.capture_exception and keep its backtrace alongside the errors the integration captures.