How to instrument a standalone .NET application (does not run under IIS) so that it reports metrics with Custom Process Name.

Document ID : KB000045913
Last Modified Date : 14/02/2018
Show Technical Document Details

Question:

How to instrument a standalone .NET application (does not run under IIS) so that it reports metrics with Custom Process Name.

 

Answer:

This example uses a simple .NET standalone Calculator application built with Visual Studio project file downloaded from here:

Windows Dev Center - Desktop > Samples > Simple Calculator

The executable name is MyCalculatorv1.exe

Detailed Steps:

1. Make a custom copy of the AGENT_HOME\wily\IntroscopeAgent.profile file as IntroscopeAgent_MyCalculator.profile and edit as follows:

introscope.agent.customProcessName=MyCalculator

introscope.agent.dotnet.monitorApplications=MyCalculatorv1.exe 

2. Edit file MyCalculatorv1.exe.config as follows:

a. Open AGENT_HOME\wily\Sample.exe.config and copy all text between <configuration> & </configuration>

b. Paste into MyCalculatorv1.exe.config after the existing <startup> section

c. Modify these 2 lines to point to correct location of the agent profile and wily.Agent.dll file

            <add key="com.wily.introscope.agentProfile" value="C:\\AGENT_HOME\\wily\\IntroscopeAgent_MyCalculator.profile" />

            href="file://C:\\AGENT_HOME\\wily\\bin\\wily.Agent.dll"/>

d. The  <runtime> section for specifying wily.Agent.dll is not required and can be removed

3. Start the application MyCalculatorv1.exe and data should be seen in the Investigator under Custom Process Name MyCalculator

mycalculator.jpg

Log files will also appear in the AGENT_HOME\\wily\logs directory

AutoProbe.MyCalculatorv1_exe.log

IntroscopeAgent.MyCalculatorv1_exe.log

 

Additional Information:

a. Files for above

MyCalculatorv1.zip

IntroscopeAgent_MyCalculator.profile

agent_logs.zip

b. Documentation references:

Implementing Agents > NET Agent > Customizing Instrumentation > Modifying the default instrumentation > Instrument processes and applications that run outside of IIS  NOTE: There is no need to set "introscope.agent.dotnet.runInRestrictedMode=false" as its default value is false (What's meaning of the property introscope.agent.dotnet.runInRestrictedMode)

Implementing Agents > NET Agent > Application-Specific Configuration

File Attachments:
TEC1554007.zip