← All platforms

ASGI error tracking

A custom async app still needs somewhere to send its errors. Wrap it with the Sentry ASGI middleware and keep the reports on your Telebugs server.

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

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.

What does the ASGI middleware do?

It wraps your application and reports exceptions that escape request handling. Telebugs keeps the error, its backtrace, and the request context the SDK sends.

What if my framework has its own integration?

Use that instead. Dedicated integrations for Django, Flask, and FastAPI know more about their frameworks.