FastAPI guide
FastAPI error tracking
Errilo receives your FastAPI errors from the official sentry-sdk package: exceptions raised in your routes, with the failing frame of your code. Already on Sentry? Only the DSN changes.
Errilo is in private beta. This guide describes the setup our compatibility suite tests today.
What gets caught
- An exception raised in a route handler: the SDK’s FastAPI integration reports it with the failing frame of your module.
- A chained exception (
raise … from …): both exceptions arrive, the cause first. - A message logged at
ERRORlevel withlogging, as an issue.
Our compatibility suite runs a FastAPI app in a container, sends it a request that raises, and checks in Errilo that the issue has the right title and the failing frame of your module, for every SDK version listed below.
A secret in the request body or in a local variable of a frame never reaches Errilo in clear: with send_default_pii on, the SDK sends it and Errilo scrubs it on receipt, which our suite checks.
Not covered by our suite: other ASGI frameworks and Python workers (Celery, RQ), which use the same SDK. Errilo stores no tracing or profiling: leave them off.
Setup
Install the SDK with its FastAPI extra:
pip install "sentry-sdk[fastapi]"Then initialise it before the app is created, with the DSN of your Errilo project. If you already have a Sentry setup, keep it and change the DSN.
import sentry_sdk
from fastapi import FastAPI
sentry_sdk.init(
dsn="https://<key>@ingest.errilo.com/<project>",
)
app = FastAPI()Stack traces from your code
Python needs no source maps: a frame carries your file and line as they are on the server. Errilo turns the usual deployment folders (/srv/app/, /code/) into paths relative to your repository, and recognises the frames of installed packages (site-packages) as dependencies, not your code. The tests of the Errilo app cover these rules; the compatibility suite doesn’t deploy your app.
Tested versions
| Tested release | Tested version |
|---|---|
| Oldest | sentry-sdk==2.11.0 |
| In between | sentry-sdk==2.40.0 |
| Latest | sentry-sdk==2.75.0 |
Use sentry-sdk 2.11.0 or later: earlier versions lose exceptions raised inside a function under Python 3.13. Our suite runs Python 3.13, and nothing else.