---
title: Python event loop diagnostics
source: https://docs.newrelic.com/docs/apm/agents/python-agent/supported-features/python-event-loop-diagnostics
---

The [Python agent](https://docs.newrelic.com/docs/agents/python-agent/getting-started/introduction-new-relic-python) supports [asyncio](https://docs.python.org/3/library/asyncio.html) event loop diagnostics. When there are transactions blocking or delaying an event loop, the agent is able to generate diagnostics to help find and resolve them.

## Requirements

Requires [Python agent version 5.0.0.124 or higher](https://docs.newrelic.com/docs/release-notes/agent-release-notes/python-release-notes).

## View in New Relic UI

In APM, your event loop transaction data will be in the transaction breakdown table and the trace details page.

Event loop metrics will appear in the transaction **Breakdown table**:

![Where to find the APM transaction table link from Transactions in the UI](https://docs.newrelic.com/images/apm_screenshot-full_find-apm-transaction-table.webp "Find APM transaction table")

![Where to find the APM transaction table link from Transactions in the UI](https://docs.newrelic.com/images/apm_screenshot-crop_transaction-table-breakdown.webp "Find APM transaction table")

**[one.newrelic.com](https://one.newrelic.com/all-capabilities) > APM & services > (select an app) > Transactions**,  click **See transaction table**, then select a transaction: The transaction’s **Breakdown table** flags event loops with asyncio.

Time spent waiting on other transactions will be shown in the transaction **Trace details** page:

![Python event loop trace details](https://docs.newrelic.com/images/apm_screenshot-crop_transaction-breakdown-page.webp "python-event-loop-trace-details.png")

**[one.newrelic.com](https://one.newrelic.com/all-capabilities) APM & services > (select an app) > Transactions > (select a transaction trace) > Trace details:** The **Trace details** page contains a table with breakdowns for each segment (method or function call) in a transaction trace.

## Event Loop NRQL Queries

`eventLoopTime` and `eventLoopWait` attributes will be available via NRQL query. An example query might be:

```sql
SELECT count(*) AS 'count', average(eventLoopTime) AS 'loopTime', average(eventLoopWait) AS 'loopWait' 
FROM Transaction FACET name
```

## Where to diagnose event loops

Event loop diagnostics will be available by default through our existing aiohttp, sanic, and Tornado instrumentation frameworks. Coroutines using the Python agent API [background_task](https://docs.newrelic.com/docs/agents/python-agent/python-agent-api/background_task) and [web_transaction](https://docs.newrelic.com/docs/agents/python-agent/python-agent-api/webtransaction-python-agent-api) decorator APIs also support asyncio's event loops.
