Download PDF
Download page Enable Correlation for .NET Remoting.
Enable Correlation for .NET Remoting
Related pages:
Developers use .NET remoting to build distributed applications that share objects across processes or across application domains running in the same process. AppDynamics disables correlation for .NET remoting functions by default.
Instrument Applications that Use .NET Remoting
You can configure the .NET Agent to discover .NET remoting entry and exit points.
Open the
config.xml
file for editing as administrator. See 'Where to Configure Agent Properties' on Administer the .NET AgentCopy the code block below to a child element of the Machine Agent element. See .NET Agent Configuration Properties
<instrumentation> <instrumentor name="RemotingMscorlibEntryInstrumentor" enabled="true"/> <instrumentor name="RemotingExitInstrumentor" enabled="true"/> </instrumentation>
CODEFor 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="RemotingMscorlibEntryInstrumentor" enabled="true"/> <instrumentor name="RemotingExitInstrumentor" enabled="true"/> </instrumentation> </machine-agent> ... </appdynamics-agent>
CODE- Save the
config.xml
file. - Restart the
AppDynamics.Agent.Coordinator
service. - Restart instrumented applications for your changes to take effect.
If the agent does not discover the entry points after configuration, specify an agent trigger.
Specify an Agent Trigger
.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
remoting object. In this case, use the functionGetTicketStatus
to trigger the agent.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"); } } }
CODEEdit the
config.xml
file as an administrator. See Administer the .NET Agent.Update the Instrumentation element to include the
AgentTriggerInstrumentor
attribute. See .NET Agent Configuration Properties.<instrumentation> <instrumentor name="AgentTriggerInstrumentor" enabled="true" args="" /> <instrumentor name="RemotingMscorlibEntryInstrumentor" enabled="true"/> <instrumentor name="RemotingExitInstrumentor" enabled="true"/> </instrumentation>
CODESet the
AgentTriggerInstrumentor
args
value to the name of the trigger function, using information in the code block in step 1. Theargs
value should be formatted as follows:namespace.public_class.public_string
.For 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>
CODE- Save the
config.xml
file. Restart instrumented applications for your changes to take effect.