.NETのスレッドの関連付け

デフォルトでは、.NET エージェントは、共通言語ランタイム(CLR)4.x 以降で次のパターンのマルチスレッド相関に対応します。

  • Task.Start
  • Task.Run
  • TaskFactory.StartNew

.NET エージェントは、デフォルトで無効になっている次のパターンのスレッドの相関に対応します。

  • Thread.Start (CLR 2.x および CLR 4.x)
  • ThreadPool.QueueUserWorkItem (CLR 2.x および CLR 4.x)

4.3 より前のバージョンの Splunk AppDynamics では、.NET エージェントの場合、config.xml ファイル内の CLR 4 の ThreadPool.QueueUserWorkItem に相関を設定する必要はありませんでした。CLR 4 の ThreadPool.QueueUserWorkItem を明示的に呼び出す場合は、以前のバージョンから .NET エージェント 4.5 にアップグレードするときに、config.xml ファイルの CLR 4 の ThreadPool.QueueUserWorkItem に対して instrumentor を有効にする必要があります。

.NETのスレッドの関連付けを構成

config.xml で .NET エージェントのすべてのインストルメンテーション設定を構成します。「.NETエージェントの管理」を参照してください。

  1. config.xml ファイルを開き、管理者として編集します。「.NETエージェントの管理」を参照してください。
  2. 以下のコードブロックをマシンエージェントエレメントの子エレメントにコピーします。「マシン エージェント エレメント」を参照してください。
    <instrumentation>
                        <instrumentor name="ThreadCorrelationThreadPoolCLR2Instrumentor" enabled="true"/>
                        <instrumentor name="ThreadCorrelationThreadPoolCLR4Instrumentor" enabled="true"/>
                        <instrumentor name="ThreadStartCLR2Instrumentor" enabled="true"/>
                        <instrumentor name="ThreadStartCLR4Instrumentor" enabled="true"/>
                        </instrumentation>
    例:
    <?xml version="1.0" encoding="utf-8"?>
                            <appdynamics-agent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                            ...
                            <machine-agent>
                            <!--Enable thread correlation-->
                            <instrumentation>
                            <instrumentor name="ThreadCorrelationThreadPoolCLR2Instrumentor" enabled="true"/>
                            <instrumentor name="ThreadCorrelationThreadPoolCLR4Instrumentor" enabled="true"/>
                            <instrumentor name="ThreadStartCLR2Instrumentor" enabled="true"/>
                            <instrumentor name="ThreadStartCLR4Instrumentor" enabled="true"/>
                            </instrumentation>
                            </machine-agent>
                            ...
                            </appdynamics-agent>
    構成のシンタックスは enabled="true" です。
  3. config.xml ファイルを保存します。
  4. AppDynamics.Agent.Coordinator サービスを再起動します。
  5. インストゥルメント化されたアプリケーションを再起動して、変更を適用。