Customize .NET Instrumentation

By default, .NET agents use NativeProfiler to instrument all applications and application pools that run under one or more IIS worker processes. The default instrumentation provides broad and deep monitoring of the .NET environment and web applications. However, you can refine what you monitor to suit your requirements.
apmdevops106
By default, .NET agents use NativeProfiler to instrument all applications and application pools that run under one or more IIS worker processes. The default instrumentation provides broad and deep monitoring of the .NET environment and web applications. However, you can refine what you monitor to suit your requirements.
2
2
Modify the Default Instrumentation
By default, NativeProfiler instruments all IIS web applications and application pools and does not instrument any standalone applications that run outside of IIS. As your environment becomes more complex, you might modify the default instrumentation. For example, you might: 
  • change the default PBLs or PBDs deployed
  • configure the .NET agent to instrument non-IIS applications.
  • prevent specific processes or applications from being instrumented.
  • limit instrumentation to specific application pools.
To make these changes, you must configure the .NET agent profile.
Specify the Default ProbeBuilder Directives to Deploy
The agent profile provides a property, 
introscope.autoprobe.directivesFile
, that specifies which ProbeBuilder Directive (.pbd) files should be deployed. Individual ProbeBuilder Directive files control the specific probes, such as timers and counters, which are inserted into the code. They can be grouped in ProbeBuilder List (.pbl) files that define a set of .pbd files to deploy. When you install the agent, the 
introscope.autoprobe.directivesFile
 is configured to use the files that are listed in the default-full.pbl to instrument your applications. The default-full.pbl references .pbd files that demonstrate full instrumentation across all .NET components. You can modify the 
introscope.autoprobe.directivesFile
 property to use a different .pbl, list specific .pbd files, or modify the list of .pbd files that are listed in the .pbl that you want to deploy.
The most common way to change the default ProbeBuilder Directives that is deployed is to modify the
 introscope.autoprobe.directivesFile
 property to use the default-typical.pbl file. The default-typical.pbl file references .pbd files that instrument a subset of components to be monitored.
To Change from Full to Typical Instrumentation:
  1. Stop IIS.
  2. Open the 
    I
    ntroscopeAgent.profile file in a text editor.
  3. Locate the 
    introscope.autoprobe.directivesFile
     property.
  4. Change default-full.pbl to default-typical.pbl. For example:
    introscope.autoprobe.directivesFile=default-typical.pbl,hotdeploy
  5. Save and close the file.
  6. Restart the IIS.
Instrument Processes and Applications that Run Outside of IIS
You can modify the .NET agent profile to include monitoring applications that run outside of IIS. Before you modify the profile, have the exact names of the application executables that you want to include.
Follow these steps:
  1. Stop the IIS.
  2. Open the IntroscopeAgent.profile in a text editor.
  3. Locate the 
    Restricted Instrumentation
     section.
  4. Add application names to this property:
    introscope.agent.dotnet.monitorApplications
    By default, 
    w3wp.exe
     and 
    aspnet_wp.exe
     are already listed for this property. You can add other application names that you separate by a comma. For example:
    introscope.agent.dotnet.monitorApplications=w3wp.exe,aspnet_wp.exe,RandomApp.exe,testapp.exe,readloop.exe
    The property list is case-sensitive. Relative paths and wildcards are not supported. Full-path specification is not supported; use the application name only.
  5. Add this property to the IntroscopeAgent.profile and set it to 
    false
    :
    introscope.agent.dotnet.runInRestrictedMode=false
  6. Save and close the file.
  7. Restart the process.
If you want to disable monitoring of an application, remove it from the 
introscope.agent.dotnet.monitorApplications
 property list. The CLR profiler for the removed application remains active. The NativeProfiler is turned off and the .NET agent that is associated with the application does not connect to the Enterprise Manager or report metrics.
Instrument Specific Application Pools
By default, all application pools are instrumented. However, you can limit the IIS applications that are instrumented. For example, if you want to reduce overhead or you want to focus monitoring on only the most critical resources. To limit the applications that the .NET agent monitors, you must configure the introscopeagent.profile. You must identify the specific application pools that you want to instrument.
Follow these steps:
  1. Stop the IIS.
  2. Open the IntroscopeAgent.profile in a text editor.
  3. Locate the 
    Restricted Instrumentation
     section.
  4. Uncomment this property:
    introscope.agent.dotnet.monitorAppPools=
  5. Add the application pools that you want to instrument to the property in a comma-separated list. For example:
    introscope.agent.dotnet.monitorAppPools="NULL","DefaultAppPool","AppPool1","AppPool2"
    IIS 5 can run without application pools. Use the "Null" value if you are instrumenting applications running in IIS 5.
  6. Save and close the file.
  7. Restart the IIS.