メモ
Pythonエージェントのこのリリースでは、 LangGraphエージェントのサポートが追加されています。
Python パッケージ インデックス経由でeasy_install/pip/distributeを使用するか、 Conda-Forge パッケージ インデックス経由でcondaを使用してエージェントをインストールするか、 New Relic ダウンロード サイトから直接ダウンロードします。
特徴
LangGraphエージェントのサポートを追加
- LangChainの
create_agent()を介した LangGraph エージェント呼び出しの計装を追加します。 これには、invoke()、ainvoke()、stream()、およびastream()へのエージェント呼び出しが含まれます。
- LangChainの
サポートステートメント
最新のエージェント バージョンが利用可能になったらすぐに更新することをお勧めします。最新バージョンにアップグレードできない場合は、エージェントを 90 日以内のバージョンに更新してください。エージェントを最新の状態に保つ方法の詳細については、こちらをご覧ください。
エージェントのリリースとサポート日については、New Relic Python エージェントのEOL ポリシーを参照してください。
メモ
Pythonエージェントのこのリリースでは、エラーをnotice_error()に渡す新しい方法が追加され、 Strands- synchronous ツールのエラー キャプチャのサポートが追加され、 gpt-5および新しいOpenAI LLM モデルのサポートが追加され、 Azure Functionsの使用ロジックのクラッシュが修正されています。
Python パッケージ インデックス経由でeasy_install/pip/distributeを使用するか、 Conda-Forge パッケージ インデックス経由でcondaを使用してエージェントをインストールするか、 New Relic ダウンロード サイトから直接ダウンロードします。
特徴
例外インスタンスを引数としてサポートする
notice_error()notice_error()error引数として、sys.exc_info()からの例外タプルではなく、キャッチされた例外インスタンス (try/except ブロックからのものなど) を受け入れることができるようになりました。これは既存の動作に追加されるものであり、既存の動作に代わるものではありません。引数なしまたは例外タプルを使用した
notice_error()の以前の使用は、引き続き正常に機能するはずです。
gpt-5以降の OpenAI LLM モデルのサポートを追加します- 新しいOpenAIモデルで使用される新しいプロパティ名をサポートするために、 OpenAI計装に更新を追加します。
Strands-エージェント同期ツールのエラー キャプチャのサポートを追加
- Strands-エージェントのツールとして使用される同期Python関数は、適切なエラー キャプチャを備え、データベース ルックアップなどのツール内でトレースをキャプチャできるようになりました。
バグ修正
Azure Functions の利用におけるクラッシュを防ぐ
- 以前は、一部のユーザーは、正規表現を一致させようとしたときに Azure Functions 使用率検出がクラッシュするというエッジケースを経験していました。クラッシュは修正されており、今後は発生しなくなるはずです。
サポートステートメント
最新のエージェント バージョンが利用可能になったらすぐに更新することをお勧めします。最新バージョンにアップグレードできない場合は、エージェントを 90 日以内のバージョンに更新してください。エージェントを最新の状態に保つ方法の詳細については、こちらをご覧ください。
エージェントのリリースとサポート日については、New Relic Python エージェントのEOL ポリシーを参照してください。
メモ
このリリースの Python エージェントでは、以下のサポートが追加されました。
- ストランド
- AWS Bedrock コンバースストリーミング
- Redisメソッド
hybrid_searchとmsetex - LLM イベントのLangChainロールの割り当て
- LLM 要求時にキャプチャされた LLM イベントのタイムスタンプ
loop_factory問題ありasyncio.Runner
このリリースでは、Web サーバーによってヘッダーが報告されない ASGI モジュールのバグも修正されています。
Python パッケージ インデックス経由でeasy_install/pip/distributeを使用するか、 Conda-Forge パッケージ インデックス経由でcondaを使用してエージェントをインストールするか、 New Relic ダウンロード サイトから直接ダウンロードします。
特徴
ストランドのサポートを追加
- 単一および複数エージェント (群、グラフなど) 設定にストランド ツールとエージェントの計装を追加します。
AWS Bedrock Converse Streamingのサポートを追加
- ストリーミング Converse API の監視サポートを追加します。これには、
converse_stream()を使用して boto3 および aioboto3 クライアントで行われた Converse チャット完了呼び出しのサポートが含まれます。
- ストリーミング Converse API の監視サポートを追加します。これには、
Redisメソッドのサポートを追加
次のメソッドのサポートを追加します。
hybrid_searchmsetex
loop_factoryのサポートを追加asyncio.Runner- Python 3.11 では、
asyncio.Runnerloop_factoryが追加されました。loop_factory問題は、ループ ポリシーの代替手段を提供します。 これで、グローバル イベント ループ設定またはカスタムイベント ループのどちらを介したものであっても、作成されたループはインストゥルメント化されます。
- Python 3.11 では、
LLM イベントでLangChain のロール割り当てをキャプチャする
- LangChain
LlmChatCompletionMessageイベントには、 LangChainから割り当てられたロールが含まれるようになりました。
- LangChain
LLM 要求時に LLM イベントのタイムスタンプをキャプチャします。
- 以前は、LLM イベントのタイムスタンプはイベントの作成時にキャプチャされていました。現在では、LLM リクエスト時により正確にキャプチャされるようになりました。
バグ修正
ASGIヘッダーの消費
ASGIWebTransactionがhttp.response.startイベントからヘッダーを使用する際、許容される入力タイプを考慮せずに使用していました。ヘッダーがジェネレーターである場合、ジェネレーターはprocess_response()呼び出しによって消費され、Web サーバーが送信するヘッダーが残っていません。これは修正されました。
サポートステートメント
最新のエージェント バージョンが利用可能になったらすぐに更新することをお勧めします。最新バージョンにアップグレードできない場合は、エージェントを 90 日以内のバージョンに更新してください。エージェントを最新の状態に保つ方法の詳細については、こちらをご覧ください。
エージェントのリリースとサポート日については、New Relic Python エージェントのEOL ポリシーを参照してください。
メモ
このリリースの Python エージェントでは、Python 3.14 のサポート、属性フィルター設定用の新しい環境変数、トランザクション デコレータの非同期ジェネレータのサポート、 AWS Bedrockの追加モデル、 AWS Kinesisの新しいメソッドが追加されています。このリリースでは、 ConnectionPoolが複数回ラップされているときにRecursionError引き起こすaiomysqlのバグ、 kombuのプロデューサーでプロパティが適切に渡されないバグ、およびshutdown_agent収集スレッド内から呼び出されたときにエラーが発生するバグも修正されています。
Python パッケージ インデックス経由でeasy_install/pip/distributeを使用するか、 Conda-Forge パッケージ インデックス経由でcondaを使用してエージェントをインストールするか、 New Relic ダウンロード サイトから直接ダウンロードします。
特徴
Python 3.14のサポートを追加
- Python 3.14 のサポートを追加します。
属性フィルター設定用の環境変数を追加する
以下の設定は、環境変数を通じて設定できるようになりました。
構成設定 環境変数 attributes.enabledNEW_RELIC_ATTRIBUTES_ENABLEDattributes.excludeNEW_RELIC_ATTRIBUTES_EXCLUDEattributes.includeNEW_RELIC_ATTRIBUTES_INCLUDEbrowser_monitoring.attributes.enabledNEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_ENABLEDbrowser_monitoring.attributes.excludeNEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_EXCLUDEbrowser_monitoring.attributes.includeNEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_INCLUDEerror_collector.attributes.enabledNEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_ENABLEDerror_collector.attributes.excludeNEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_EXCLUDEerror_collector.attributes.includeNEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_INCLUDEspan_events.attributes.enabledNEW_RELIC_SPAN_EVENTS_ATTRIBUTES_ENABLEDspan_events.attributes.excludeNEW_RELIC_SPAN_EVENTS_ATTRIBUTES_EXCLUDEspan_events.attributes.includeNEW_RELIC_SPAN_EVENTS_ATTRIBUTES_INCLUDEtransaction_events.attributes.enabledNEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_ENABLEDtransaction_events.attributes.excludeNEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_EXCLUDEtransaction_events.attributes.includeNEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_INCLUDEtransaction_segments.attributes.enabledNEW_RELIC_TRANSACTION_SEGMENTS_ATTRIBUTES_ENABLEDtransaction_segments.attributes.excludeNEW_RELIC_TRANSACTION_SEGMENTS_ATTRIBUTES_EXCLUDEtransaction_segments.attributes.includeNEW_RELIC_TRANSACTION_SEGMENTS_ATTRIBUTES_INCLUDEtransaction_tracer.attributes.enabledNEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_ENABLEDtransaction_tracer.attributes.excludeNEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_EXCLUDEtransaction_tracer.attributes.includeNEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_INCLUDE
トランザクション デコレータに非同期ジェネレータのサポートを追加する
- 以前は、トランザクション デコレータは非同期ジェネレータをラップすることをサポートしていませんでした。このサポートが追加され、非同期ジェネレーター トランザクションはイベント ループの待機時間やその他の統計を自動的に測定するようになりました。
AWS Bedrock 計装に追加モデルのサポートを追加
botocoreおよびaiobotocoreを通じてAWS Bedrock 計装を更新し、以下の追加モデルをサポートします。
- クロード・ソネット 3+ モデル
- リージョンがプレフィックスとして付いたモデル(リージョン対応)
新しい Kinesis メソッド用の計装を追加
新しいAWS Kinesis メソッドをサポートするためにbotocore計装を追加
describe_account_settingsupdate_account_settingsupdate_max_record_sizeupdate_stream_warm_throughput
バグ修正
aiomysql ConnectionPool での再帰エラーを防ぐ
- 以前は、プールされた接続を使用すると、 aiomysqlで
RecursionErrorが発生していました。繰り返しのラッピングにより、プールされた接続の周囲に深いObjectProxyチェーンが作成されました。これは修正されました。
- 以前は、プールされた接続を使用すると、 aiomysqlで
kombuのプロデューサーでプロパティが適切に渡されないバグを修正しました
kombu.messaging.Producer.publish()の計装により、プロパティが誤って辞書内にネストされ、プロパティが間違った場所に配置され、下流のパッケージによって読み取られなくなるバグを修正しました。
shutdown_agentが収集スレッド内から呼び出されたときのエラーを修正しました- 以前は、
shutdown_agent収集スレッド内から呼び出されたときにRuntimeErrorが発生する可能性がありました。これにより、クラッシュを防ぐガードが追加され、問題が修正されます。
- 以前は、
サポートステートメント
最新のエージェント バージョンが利用可能になったらすぐに更新することをお勧めします。最新バージョンにアップグレードできない場合は、エージェントを 90 日以内のバージョンに更新してください。エージェントを最新の状態に保つ方法の詳細については、こちらをご覧ください。
エージェントのリリースとサポート日については、New Relic Python エージェントのEOL ポリシーを参照してください。
メモ
Pythonエージェントのこのリリースでは、 Django計装の早期アクティベーションの修正、無視されるmax_samples_storedサーバー側オーバーライド、およびtrace_cache.pop()からのクラッシュに対する保護が提供されます。
Python パッケージ インデックス経由でeasy_install/pip/distributeを使用してエージェントをインストールするか、 New Relic ダウンロード サイトから直接ダウンロードします。
バグ修正
Django計装での早期アクティベーションを防止します
- フォーク前のアプリケーションでの早期アクティベーションの問題を防ぐために、 Django計装の
application_settings()への呼び出しを削除します。
- フォーク前のアプリケーションでの早期アクティベーションの問題を防ぐために、 Django計装の
サーバー設定とローカル設定の同期の問題を修正
- これは、
event_harvest_config.harvest_limits.*設定が廃止され、*.max_samples_stored設定に置き換えられたときに発生したバグを修正します。一部のサーバー側設定がクライアント側設定をオーバーライドしていないため、ユーザーがこれを無効にしているにもかかわらず、データがコレクターに送信されてしまいました。
- これは、
衝突から守る
trace_cache.pop()ContextOfクラスで、デフォルト値のないpop(key)経由のtrace_cacheへの安全でないアクセスがありました。これにより、辞書内のweakrefがすでにガベージ コレクションされている場合にクラッシュが発生しました。
サポートステートメント
最新のエージェント バージョンが利用可能になったらすぐに更新することをお勧めします。最新バージョンにアップグレードできない場合は、エージェントを 90 日以内のバージョンに更新してください。エージェントを最新の状態に保つ方法の詳細については、こちらをご覧ください。
エージェントのリリースとサポート日については、New Relic Python エージェントのEOL ポリシーを参照してください。
Notes
注意
This version of the agent has been yanked.
This release of the Python agent makes the following changes:
- Removes support for Python 3.7
- Removes and or deprecates various APIs and settings
- Deprecates aioredis instrumentation
- Raises the minimum supported version of
setuptoolsandsetuptools_scm - Adds new instrumentation for AutoGen
- Adds new instrumentation for Pyzeebe
- Adds new MCP (Model Context Protocol) named spans
- Fixes a crash in psycopg
- Ensures MCP spans are only recorded when AI monitoring is enabled
Install the agent using easy_install/pip/distribute via the Python Package Index or download it directly from the New Relic download site.
Removed features
Removes support for Python 3.7
- Python 3.7 was EOL'd June 27, 2023. The Python agent has dropped support for it.
Removes various deprecated APIs
The following APIs have been removed:
Legacy API Replacement API accept_distributed_trace_payloadaccept_distributed_trace_headersadd_custom_parameteradd_custom_attributeadd_custom_parametersadd_custom_attributescreate_distributed_trace_payloadinsert_distributed_trace_headersget_browser_timing_footerThe functionality of this has been wrapped into get_browser_timing_header()record_exceptionnotice_error()NewRelicLogHandlerNewRelicLogForwardingHandlerlambda_handler&LambdaHandlerWrapperThese APIs have moved to the newrelic-lambdapackage.
Removes various deprecated settings
The following settings have been removed:
Legacy Setting Replacement Setting transaction_tracer.capture_attributestransaction_tracer.attributes.enablederror_collector.capture_attributeserror_collector.attributes.enabledbrowser_monitoring.capture_attributesbrowser_monitoring.attributes.enabledanalytics_events.enabledtransaction_events.enabledanalytics_events.capture_attributestransaction_events.attributes.enablederror_collector.ignore_errorserror_collector.ignore_classesstrip_exception_messages.whiteliststrip_exception_messages.allowlistsslThis is now hardcoded to trueso it has been removed as a setting option.ignored_paramsUse newrelic.attributes.exclude = request.parameters.{name}instead. Add each request parameter key to thenewrelic.attributes.excludelist, delimited by commas. Be sure to prepend the key withrequest.parameters.agent_limits.merge_stats_maximumThis is now completely ignored in favor of serverside config.
Deprecated features
Instrumentation for aioredis has been deprecated
Deprecates some existing harvest settings to match other language agents
In order to be more consistent with the conventions of the other language agents, the following harvest settings are now deprecated:
Legacy Setting Replacement Setting event_harvest_config.harvest_limits.analytic_event_datatransaction_events.max_samples_storedevent_harvest_config.harvest_limits.span_event_dataspan_events.max_samples_storedevent_harvest_config.harvest_limits.error_event_dataerror_collector.max_event_samples_storedevent_harvest_config.harvest_limits.custom_event_datacustom_insights_events.max_samples_storedevent_harvest_config.harvest_limits.log_event_dataapplication_logging.forwarding.max_samples_storedThis is a revert of a previous change that renamed these settings from
*.max_samples_storedto theevent_harvest_config.harvest_limits.*form. This decision has been reversed, and the original settings named have been restored to match the other language agents who did not change these settings names. The deprecated settings will continue to work for now, but they will be removed in a future release.
Deprecates configuration of the agent through the WSGI environ dictionary
The following settings which were previously possible to configure through the WSGI environ dictionary are now deprecated. Please configure these settings through environment variables or the config file.
newrelic.set_background_tasknewrelic.suppress_apdex_metricnewrelic.suppress_transaction_tracenewrelic.capture_request_paramsnewrelic.disable_browser_autorum
Deprecates support for building the agent with
setuptools<61.2orsetuptools_scm<6.4- The minimum supported versions of
setuptoolsandsetuptools_scmhave been increased to61.2and6.4respectively. This is to support the use ofpyproject.tomlfor configuring the package metadata and building instructions. The agent can now be built with more modern build tools which will no longer log warnings about the lack of apyproject.tomlfile. - This change adds new version attributes to the packages,
newrelic.__version__andnewrelic.__version_tuple__, which can be used to programmatically check the version of the agent at runtime.
- The minimum supported versions of
New features
Adds new instrumentation for AutoGen
- Adds instrumentation (named spans and custom
Llmevents) for agents and tools in AutoGen
- Adds instrumentation (named spans and custom
Adds new instrumentation for Pyzeebe
- Adds automatic instrumentation and framework-specific agent attributes for Pyzeebe
Adds new MCP (Model Context Protocol) named spans
- Adds new named spans for MCP (Model Context Protocol) tool calls made via tool manager to support Streamable HTTP
Bug fixes
Fixes a crash in
psycopg>=3.2.0when callingas_string()- Fixes an issue in
psycopg>=3.2.0where theas_string()method no longer required arguments, causing a potential crash. This has been fixed, and both signatures of this method are supported.
- Fixes an issue in
Ensures MCP (Model Context Protocol) spans are only recorded when AI monitoring is enabled
- Ensures MCP (Model Context Protocol) spans are only recorded when the setting
ai_monitoring.enabledis enabled.
- Ensures MCP (Model Context Protocol) spans are only recorded when the setting
Support statement
We recommend updating to the latest agent version as soon as it's available. If you can't upgrade to the latest version, update your agents to a version no more than 90 days old. Read more about keeping agents up to date.
See the New Relic Python agent EOL policy for information about agent releases and support dates.