.NET remoting entry point functions execute in low-level .NET libraries that may not trigger automatic agent instrumentation. If the agent does not discover the .NET remoting entry points after configuration you can specify a function that triggers the agent to begin instrumentation.
- Identify a function to trigger the agent to begin instrumentation. The function can be any function that executes as part of the application process.For example, consider the following code for a 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");
}
}
}
- Edit the config.xml Administer the .NET Agent.
- Update the Instrumentation element to include the AgentTriggerInstrumentor .NET Agent Configuration Properties.
<instrumentation>
<instrumentor name="AgentTriggerInstrumentor" enabled="true" args="" />
<instrumentor name="RemotingMscorlibEntryInstrumentor" enabled="true"/>
<instrumentor name="RemotingExitInstrumentor" enabled="true"/>
</instrumentation>
- Set the AgentTriggerInstrumentor args args namespace.public_class.public_stringFor example:
<?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>
- Save the
config.xml file.
- Restart instrumented applications for your changes to take effect.