Read about the requirements and tips for integrating our Python agent with an app that uses the FastAPI web framework. To return to the general install instructions, go to Install the Python agent.
Automatic initialization with admin script
If you start your app with python app.py
and use our Python agent version 5.22.0.151 or higher, you can use the recommended admin script integration method.
Here's an example using the admin script method:
NEW_RELIC_CONFIG_FILE=path/to/newrelic.ini newrelic-admin run-program [web server] path_to_app
Python agent API
You can use the Python agent API to monitor any ASGI server or framework. To do this, mark the ASGI application entry point and set the transaction names.
Event loop diagnostic support
Our Python agent supports asyncio
event loop diagnostics. For more information, see Python event loop diagnostics.
cs).
For more help
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's and and documentation.