• English日本語한국어
  • Log inStart now


The Python agent supports recording database transactions when using the asyncpg database client module for PostgresSQL. This feature captures timing of database queries, SQL statements for the database query, and a stack trace for long database queries.

Read about the requirements and tips for integrating our Python agent with an app that uses asyncpg. 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 or higher, you can use the recommended admin script integration method For example:

NEW_RELIC_CONFIG_FILE=path/to/newrelic.ini newrelic-admin run-program python path_to_app

Using the 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.

Copyright © 2023 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.