Python エージェント は、 asyncio イベントループの診断をサポートしています。イベントループをブロックまたは遅延させるトランザクションがある場合、エージェントはそれらを見つけて解決するための診断を生成することができます。
要件
Requires Python agent version 5.0.0.124 or higher.
New Relic UIでの表示
APMでは、イベントループのトランザクションデータは、トランザクションの内訳表とトレースの詳細ページに表示されます。
イベントループメトリクスは トランザクションBreakdown tableに表示されます:


one.newrelic.com > APM & services > (select an app) > Transactions、 See transaction tableをクリックして、トランザクションを選択します。トランザクションのBreakdown table 、asyncio によるイベント ループにフラグを設定します。
他の トランザクション を待機する時間は トランザクションTrace detailsページに表示されます。

one.newrelic.com APM & services > (select an app) > Transactions > (select a transaction trace) > Trace details: Trace detailsページには、トレース内の各セグメント (メソッドまたは関数呼び出し) の内訳を示す表が含まれています。
イベントループ NRQL クエリ
eventLoopTime
eventLoopWait
属性はNRQLクエリを介して利用可能になります。クエリの例は次のとおりです。
SELECT count(*) AS 'count', average(eventLoopTime) AS 'loopTime', average(eventLoopWait) AS 'loopWait' FROM Transaction FACET name
イベントループをどこで診断するか
イベントループの診断は、既存のaiohttp、sanic、Tornadoのインスツルメンテーション・フレームワークを通じてデフォルトで利用できるようになります。Python エージェント API background_task と web_transaction デコレーター API を使用したコルーチンも asyncio のイベントループをサポートします。