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.

Updated

Errilo is in private beta. This guide describes the setup our compatibility suite tests today.

What gets caught

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.

main.py
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

Versions of sentry-sdk tested against Errilo
Tested releaseTested version
Oldestsentry-sdk==2.11.0
In betweensentry-sdk==2.40.0
Latestsentry-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.

Early access

The private beta is open, by invitation, to a handful of teams running a JavaScript, TypeScript, PHP or Python app in production. Join the waitlist and we’ll write to invite you.