Our Flask integration lets you instrument individual HTTP requests by adding a dedicated WSGI middleware to your application.
The recommended way to use Blackfire with Flask is to use the blackfire-python command, as it configures the needed bits for you.
Run your webserver with
export FLASK_APP=hello.py blackfire-python flask run
blackfire-python gunicorn myproject:app
If you prefer configuring Flask manually, you can add the following call manually within your code:
import blackfire blackfire.patch_all()
This call should be made as early as possible in the lifecycle of an application,
ideally before any other
Then, restart your server.
We used to provide a Flask middleware along with the Blackfire Python SDK,
This middleware is now deprecated in favor of the
blackfire-python or the
Using the middleware will trigger a deprecation warning.