Skip to main content
Profile slow FastAPI requests with PyInstrument. It is off by default.

Turn it on

1

Enable it

In apps/api/.env:
2

Restart the API

Restart mise dev, then look for the PyInstrument profiling line in the startup logs.
3

Profile a request

Add ?profile=1 to any request. You get an HTML report instead of JSON.
With mise dev --agent running, no sign-in header is needed.

Options

The default sample rate profiles every request. Lower it whenever you enable profiling: 0.1 for development, 0.01 for production. Use 0.0 for manual ?profile=1 only.
?profile= accepts 1, true, or yes.

Troubleshooting