A FastAPI middleware that integrates pyinstrument for performance profiling, request statistics, and a built-in dashboard.
fastapi_profiler is a FastAPI middleware that integrates the pyinstrument profiler to provide detailed performance profiling for web applications. It helps developers identify bottlenecks, monitor request performance, and optimize their services with features like per-request profiling, sampling rate control, and a built-in Web UI dashboard. The tool is designed to be lightweight and production-ready, offering minimal overhead and extensive configuration options.
FastAPI developers and backend engineers who need to monitor and optimize the performance of their web services in development, staging, or production environments. It is particularly useful for teams requiring detailed request-level profiling and runtime performance analytics.
Developers choose fastapi_profiler for its seamless integration with FastAPI, production-focused features like configurable sampling and structured JSON logging, and the unique built-in dashboard for real-time performance monitoring. Its ability to profile errors automatically and toggle profiling at runtime without server restarts provides flexibility and control not always found in alternative profiling tools.
A FastAPI Middleware of https://github.com/joerick/pyinstrument to check your service performance.
Integrates directly as a middleware with add_middleware(), requiring minimal code changes and leveraging FastAPI's ecosystem for easy setup.
Offers configurable sampling rates, slow request thresholds, and automatic error profiling to balance detail with overhead in live environments.
Includes a real-time UI for viewing request stats, profile history, and runtime configuration, eliminating the need for external monitoring tools.
Outputs profiling data in JSON format, enabling straightforward integration with centralized logging systems like ELK or Splunk.
For HTML, JSON, and other file-based outputs, it overwrites the same file on each request, which can obscure historical data unless managed externally.
The dashboard exposes API endpoints that, if not filtered or secured, could be accessed unauthorized, posing a potential vulnerability in production deployments.
With over a dozen parameters like profiler_output_type and sample_rate, setup can be intricate and error-prone for users new to profiling.
:rocket: CLI tool for FastAPI. Generating new FastAPI projects & boilerplates made easy.
This code generator creates FastAPI app from an openapi file.
api versioning for fastapi web applications
Developer productivity tool for making high-quality FastAPI production-ready APIs.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.