← All platforms

FastAPI error tracking

Even a well-typed API can throw. The Sentry FastAPI integration sends unexpected exceptions to Telebugs on your server.

~/hoofnotes  python -m pip install sentry-sdk
~/hoofnotes  nvim app.py
import sentry_sdk
from fastapi import FastAPI
sentry_sdk.init(
# Copy the complete Telebugs DSN, key and path included.
dsn="YOUR_TELEBUGS_DSN",
)
app = FastAPI()
# Remove this test route after checking Telebugs.
@app.get("/telebugs-test")
async def check_notes():
raise RuntimeError("Hello from Hoof Notes")
~/hoofnotes  uvicorn app:app

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

Hang on, I already use Sentry

Keep sentry-sdk. Point it at your Telebugs DSN and keep reporting errors as before. The reports go to your server; you don’t need a Sentry account.

Does it work with async endpoints?

Yes. The Sentry integration supports FastAPI’s request handling, including async endpoints. Unexpected exceptions arrive with their Python backtraces.

Will a 404 fill up my error tracker?

No. Expected HTTP errors aren’t reported by default. Telebugs receives the unexpected exceptions the SDK captures, plus anything you choose to report yourself.