BugsRadar

FastAPI

Updated 1 October 2026 · BugsRadar team

Uvicorn logs every unhandled exception to its uvicorn.error logger, so one init call is enough. To see the path of the request as well, report from an exception handler; the error still arrives once.

Install the package first: pip install bugsradar (see Install). The API key is secret: where it may go.

main.py

main.py
import os
import bugsradar
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse

bugsradar.init(api_key=os.environ["BUGSRADAR_KEY"])
app = FastAPI()

@app.exception_handler(Exception)
async def report_error(request: Request, error: Exception):
    bugsradar.send_exception(error, properties={"path": request.url.path})
    return JSONResponse(status_code=500, content={"detail": "Internal Server Error"})

What arrives

Every record at ERROR and above arrives, from the framework's loggers and from your own alike: see the logging module. Exceptions you catch yourself go through direct calls. What the message looks like in the chat, how repeats are counted and when errors are bundled: see What you receive.

Next: Send alerts from any script →