fastapi-radar是应用程序的调试仪表板,提供实时请求、数据库查询和异常监控。只需一行即可为 FastAPI 应用程序添加强大的监控!。用于 FastAPI 应用程序的强大调试仪表板,使用漂亮的 React UI 实时监控 HTTP 请求、SQL 查询和异常,单线集成,无需配置。
pip install fastapi-radarfrom fastapi import FastAPIfrom fastapi_radar import Radarfrom sqlalchemy import create_engineapp = FastAPI()engine = create_engine("sqlite:///./app.db")# That's it! One line to add complete monitoringradar = Radar(app, db_engine=engine)radar.create_tables()# Your routes work unchanged@app.get("/users")async def get_users(): return {"users": []}访问地址:http://localhost:8000/\_\_radar/
radar = Radar( app, db_engine=engine, dashboard_path="/__radar", # Custom dashboard path enable_in_production=False, # Disable in production capture_body=True, # Capture request/response bodies capture_headers=True, # Capture headers max_body_size=10000, # Max body size to capture)项目地址:https://github.com/doganarif/fastapi-radar.git
长按或扫描下方二维码,免费获取 Python公开课和大佬打包整理的几百G的学习资料,内容包含但不限于Python电子书、教程、项目接单、源码等等 推荐阅读
点击 阅读原文 了解更多