← All platforms

WSGI error tracking

Your WSGI app doesn’t need a fashionable framework to have proper error reports. The Sentry middleware sends its exceptions to Telebugs on your server.

~/hoofnotes  pip install sentry-sdk
~/hoofnotes  nvim wsgi.py
import sentry_sdk
sentry_sdk.init(
# Copy the complete Telebugs DSN, key and path included.
dsn="YOUR_TELEBUGS_DSN",
)
from sentry_sdk.integrations.wsgi import SentryWsgiMiddleware
from hoofnotes.app import app
application = SentryWsgiMiddleware(app)
~/hoofnotes  gunicorn wsgi: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 WSGI 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.