Configuring additional features for .NET Framework monitoring
After you have basic .NET Framework monitoring set up, you can configure additional features to enhance your monitoring capabilities.
This topic covers the following additional features:
Custom tracing
.NET Tracing SDK on Instana enables custom tracing for components that Instana does not trace automatically.
Ignoring processes
You can exclude specific processes from .NET Framework tracing by configuring an environment variable.
To ignore monitoring of certain processes in Windows, complete the following steps:
- Add the
INSTANA_REWRITER_BACKOFFenvironment variable on the host level. - Set its value to a list of pool names or process names that is separated by semicolons as shown in the following example:
INSTANA_REWRITER_BACKOFF=my_pool_1;process_1;my_pool_2 - Restart the IIS services with the
iisresetcommand so that IIS can load the new environment.
Whitelisting processes
You can configure Instana to trace only specific processes by using the whitelist feature. When the whitelist is configured, only processes that match the specified patterns are instrumented for tracing. All other processes are excluded.
The whitelist feature uses case-insensitive regular expressions and supports semicolon-separated values, enabling you to define multiple patterns for flexible process matching.
To enable whitelisting for specific processes, complete the following steps:
- Add the
INSTANA_NET_WHITELISTenvironment variable on the host level. - Set its value to a semicolon-separated list of process names or regex patterns as shown in the following example:
INSTANA_NET_WHITELIST="^(weBapi|cORe).*;DefaultAppPool;myApp.exe"where:
^(weBapi|cORe).*matches processes starting withwebapiorcore(case-insensitive). This pattern uses regex anchors and wildcards to match multiple related applications.DefaultAppPoolperforms a case-insensitive match against IIS application pool names that start withDefaultAppPool. For example, it matches IIS pools likeDefaultAppPoolorDefaultAppPoolAPI.myApp.exematches the specific application with full file name and file extension.
- For IIS-hosted applications, restart the IIS services with the
iisresetcommand so that the environment variable takes effect. For non-IIS applications, restart the application.
When the whitelist is configured, the profiler checks each process against the whitelist patterns during initialization. Only processes that match at least one pattern are instrumented. If no match is found, the profiler exits without attaching to the process.
The whitelist feature is particularly useful in environments where you want to:
- Reduce overhead by tracing only critical applications
- Isolate specific services for monitoring
- Exclude nonproduction or test processes from tracing
INSTANA_NET_WHITELIST environment variable is not set or is empty, all processes are eligible for tracing (subject to any blacklist rules configured with INSTANA_REWRITER_BACKOFF).Configuring span filtering
You can use the span filtering feature to control which spans are collected and sent to Instana, helping you reduce data volume and focus on the most relevant traces. The .NET sensor supports flexible span filtering through multiple configuration methods.
For details, see Span filtering.
Enabling AutoProfile
For .NET Framework users, AutoProfile is available for applications that run .NET Framework 4.7.2 or later.
To enable AutoProfile, complete the following steps:
- Add the following settings to your agent's configuration.yml file:
com.instana.plugin.clr: profiling: enabled: true - Set the environment variable
INSTANA_AUTO_PROFILEtotrue.
For more information, see Analyze Profiles.