.NET Remotingの関連付けを有効化

開発者は .NET Remoting を使用して、複数のプロセスまたは同じプロセス内で実行中のアプリケーションドメインでオブジェクトを共有している分散アプリケーションを構築します。AppDynamicsはデフォルトで、.NET Remoting機能の相関を無効化しています。

.NET Remoting を使用するアプリケーションのインストゥルメント化

.NET リモート処理のエントリポイントとイグジットポイントを検出するように .NET エージェントを構成できます。

  1. config.xml を開きます。.NET エージェントの管理
  2. 以下のコードブロックをマシンエージェントエレメントの子エレメントにコピーします。「.NET エージェントの構成プロパティ」を参照してください。
    <instrumentation>
    <instrumentor name="RemotingMscorlibEntryInstrumentor" enabled="true"/>
    <instrumentor name="RemotingExitInstrumentor" 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 correlation for .NET remoting-->
    <instrumentation>
    <instrumentor name="RemotingMscorlibEntryInstrumentor" enabled="true"/>
    <instrumentor name="RemotingExitInstrumentor" enabled="true"/>
    </instrumentation>
    </machine-agent>
    ...
    </appdynamics-agent>
  3. config.xml ファイルを保存します。
  4. AppDynamics.Agent.Coordinator サービスを再起動します。
  5. インストゥルメント化されたアプリケーションを再起動して、変更を適用。
構成してもエージェントによりエントリポイントが検出されない場合は、エージェントトリガーを指定します。

エージェントトリガーの指定

.NET Remoting のエントリポイント関数は、自動エージェント インストルメンテーションをトリガーしない可能性がある低レベルの .NET ライブラリで実行されます。構成後にエージェントが .NET Remoting のエントリポイントを検出しない場合は、エージェントがインストルメンテーションを開始するようにトリガーする関数を指定できます。

  1. インストルメンテーションを開始するためにエージェントをトリガーする関数を指定。この関数は、アプリケーションプロセスの一環として実行される任意の関数です。たとえば、MovieTicket の次のコードについて検討します。GetTicketStatus
    using System;
    namespace MovieGoer
    {
    public class MovieTicket : MarshalByRefObject
    {
    public MovieTicket()
    {
    }
    public string GetTicketStatus(string stringToPrint)
    {
    return String.Format("Enquiry for {0} -- Sending back status: {1}", stringToPrint, "Ticket Confirmed");
    }
    }
    }
  2. config.xml を編集します.NET エージェントの管理
  3. AgentTriggerInstrumentor を含めるように Instrumentation エレメントを更新します.NETエージェントの構成プロパティ
    <instrumentation>
    <instrumentor name="AgentTriggerInstrumentor" enabled="true" args="" />
    <instrumentor name="RemotingMscorlibEntryInstrumentor" enabled="true"/>
    <instrumentor name="RemotingExitInstrumentor" enabled="true"/>
    </instrumentation>
  4. AgentTriggerInstrumentor args args namespace.public_class.public_string を設定します。例:
    <?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 correlation for .NET remoting-->
    <instrumentation>
    <instrumentor name="AgentTriggerInstrumentor" enabled="true" args="MovieGoer.MovieTicket.GetTicketStatus" />
    <instrumentor name="RemotingMscorlibEntryInstrumentor" enabled="true"/>
    <instrumentor name="RemotingExitInstrumentor" enabled="true"/>
    </instrumentation>
    </machine-agent>
    ...
    </appdynamics-agent>
  5. config.xml ファイルを保存します。
  6. インストゥルメント化されたアプリケーションを再起動して、変更を適用。