Skip to main content

A debugging dashboard for FastAPI applications with real-time monitoring

Project description

FastAPI Radar

Python Version License: MIT

A debugging dashboard for FastAPI applications providing real-time request, database query, and exception monitoring.

Just one line to add powerful monitoring to your FastAPI app!

See it in Action

FastAPI Radar Dashboard Demo

Installation

pip install fastapi-radar

Or with your favorite package manager:

# Using poetry
poetry add fastapi-radar

# Using pipenv
pipenv install fastapi-radar

Note: The dashboard comes pre-built! No need to build anything - just install and use.

Quick Start

With SQL Database (Full Monitoring)

from fastapi import FastAPI
from fastapi_radar import Radar
from sqlalchemy import create_engine

app = FastAPI()
engine = create_engine("sqlite:///./app.db")

# Full monitoring with SQL query tracking
radar = Radar(app, db_engine=engine)
radar.create_tables()

# Your routes work unchanged
@app.get("/users")
async def get_users():
    return {"users": []}

Without SQL Database (HTTP & Exception Monitoring)

from fastapi import FastAPI
from fastapi_radar import Radar

app = FastAPI()

# Monitor HTTP requests and exceptions only
# Perfect for NoSQL databases, external APIs, or database-less apps
radar = Radar(app)  # No db_engine parameter needed!
radar.create_tables()

@app.get("/api/data")
async def get_data():
    # Your MongoDB, Redis, or external API calls here
    return {"data": []}

Access your dashboard at: http://localhost:8000/\_\_radar/

Features

  • Zero Configuration - Works with any FastAPI app (SQL database optional)
  • Request Monitoring - Complete HTTP request/response capture with timing
  • Database Monitoring - SQL query logging with execution times (when using SQLAlchemy)
  • Exception Tracking - Automatic exception capture with stack traces
  • Real-time Updates - Live dashboard updates as requests happen
  • Flexible Integration - Use with SQL, NoSQL, or no database at all

Configuration

radar = Radar(
    app,
    db_engine=engine,            # Optional: SQLAlchemy engine for SQL query monitoring
    dashboard_path="/__radar",   # Custom dashboard path (default: "/__radar")
    max_requests=1000,           # Max requests to store (default: 1000)
    retention_hours=24,          # Data retention period (default: 24)
    slow_query_threshold=100,    # Mark queries slower than this as slow (ms)
    capture_sql_bindings=True,   # Capture SQL query parameters
    exclude_paths=["/health"],   # Paths to exclude from monitoring
    theme="auto",                # Dashboard theme: "light", "dark", or "auto"
)

What Gets Captured?

  • ✅ HTTP requests and responses
  • ✅ Response times and performance metrics
  • ✅ SQL queries with execution times
  • ✅ Query parameters and bindings
  • ✅ Slow query detection
  • ✅ Exceptions with stack traces
  • ✅ Request/response bodies and headers

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

For contributors who want to modify the codebase:

  1. Clone the repository:
git clone https://github.com/doganarif/fastapi-radar.git
cd fastapi-radar
  1. Install development dependencies:
pip install -e ".[dev]"
  1. (Optional) If modifying the dashboard UI:
cd fastapi_radar/dashboard
npm install
npm run dev  # For development with hot reload
# or
npm run build  # To rebuild the production bundle
  1. Run the example apps:
# Example with SQL database
python example_app.py

# Example without SQL database (NoSQL/in-memory)
python example_nosql_app.py

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_radar-0.1.5.tar.gz (261.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_radar-0.1.5-py3-none-any.whl (260.1 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_radar-0.1.5.tar.gz.

File metadata

  • Download URL: fastapi_radar-0.1.5.tar.gz
  • Upload date:
  • Size: 261.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.28

File hashes

Hashes for fastapi_radar-0.1.5.tar.gz
Algorithm Hash digest
SHA256 8c1eeef962ad163aebcbe82471faf05729ba37b2ff5de965ed4ea8780b2e45ab
MD5 4112ac7b934faf58762af1a25c20ef85
BLAKE2b-256 338f78df9155ed3a054cc829e3061c4c60606e409d3b7a1d83f5f68c7f635c57

See more details on using hashes here.

File details

Details for the file fastapi_radar-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_radar-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8343bf0ee737b9ea288367cb82fcac50f12b025f0d93fc6ce8da5d4d658c2b49
MD5 1643ae341a6634cd66d3f62de0dd1328
BLAKE2b-256 21db1b83c5f2dba4af385f9a4f009c04aec5ac29d208358da8c6724b48dd39bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page