fastapi-profiler
A FastAPI Middleware of pyinstrument to check your service performance.
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no security vulnerabilities, installs with minimal friction, and solves a concrete problem—profiling FastAPI request performance—with flexible configuration for both development and production use. The permissive MIT license removes any licensing concern. Install it if you need per-request profiling or a runtime-configurable performance dashboard for FastAPI.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure-Python wheel with only two runtime dependencies (fastapi and pyinstrument).
- Active maintenance with recent release and no known vulnerabilities.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
last release 2026-03-24 (143 days) · last repo commit 2026-05-12 · 365 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 200,822 downloads/mo, #9,682 on PyPI
Alternatives
Verify before relying
pip install fastapi-profiler
from fastapi import FastAPI
from fastapi_profiler import PyInstrumentProfilerMiddleware
app = FastAPI()
app.add_middleware(PyInstrumentProfilerMiddleware)
# Requests are now profiled and printed to stdout- Overhead impact of profiling on production throughput at various sampling rates
- Memory consumption when storing per-route profile history with max_profiles_per_route set high
- Dashboard performance under high request volume
What it is and what it does
fastapi-profiler wraps your FastAPI application with a middleware layer that uses pyinstrument to sample and measure the execution time of each request's call stack. It captures which functions consume the most time and reports results in multiple formats (text, HTML, JSON, prof, speedscope). The middleware supports sampling rate control to reduce overhead in production, threshold-based filtering to profile only slow requests, and structured JSON logging for integration with log aggregation systems.
The package includes a built-in web dashboard that displays per-route statistics (p95/p99 latencies, error counts, averages) and exposes APIs to toggle profiling on and off at runtime without restarting. You can exclude certain URL paths from profiling, automatically profile all 5xx errors regardless of sampling settings, and keep a rolling history of profiles per route for later inspection.
Use it for
- Identify performance bottlenecks in FastAPI endpoints by examining call trees and function-level timing data.
- Monitor production services with low-overhead sampling to detect slow requests without profiling every call.
- Generate HTML reports of request profiles for sharing with team members or archiving for later analysis.
- Use the dashboard to view live per-route statistics and toggle profiling on/off without redeploying.
- Automatically capture profiles of failed requests (5xx errors) to diagnose error-path performance issues.
- Export profiles in speedscope format for visualization in external performance analysis tools.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no security vulnerabilities, installs with minimal friction, and solves a concrete problem—profiling FastAPI request performance—with flexible configuration for both development and production use. The permissive MIT license removes any licensing concern. Install it if you need per-request profiling or a runtime-configurable performance dashboard for FastAPI.
Install
fastapi-profiler on PyPI
Before you install
Low friction: pure-Python wheel with only two runtime dependencies (fastapi and pyinstrument). Active maintenance with recent release and no known vulnerabilities.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install fastapi-profiler
from fastapi import FastAPI
from fastapi_profiler import PyInstrumentProfilerMiddleware
app = FastAPI()
app.add_middleware(PyInstrumentProfilerMiddleware)
# Requests are now profiled and printed to stdout
Verify before relying
- Overhead impact of profiling on production throughput at various sampling rates
- Memory consumption when storing per-route profile history with max_profiles_per_route set high
- Dashboard performance under high request volume
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesfastapipyinstrument |
| Maintenance | Actively maintained 143 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 200,822 / month, #9,682 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries |
Evidence: fastapi_profiler-1.5.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “fastapi request profiling”
- fastapi-profilerIntegrates pyinstrument profiling into FastAPI as middleware to…
- pyinstrumentPyinstrument is a statistical call-stack profiler that samples your…
- djdt-flamegraphIntegrates flame graph visualization into Django Debug Toolbar to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also pyinstrument · django-cprofile-middleware · yappi · py-spy · pytest-profiling · pyroscope-io · line-profiler · starlette-exporter · tuna · Pympler