Monitoring .NET Framework-based applications
Monitor your .NET Framework applications with Instana's automatic instrumentation and distributed tracing capabilities.
For .NET and .NET Core applications, see Monitoring .NET and .NET Core Applications.
Overview
Instana provides comprehensive monitoring for .NET Framework applications through:
- Automatic instrumentation: Zero-code changes required with AutoTrace
- Distributed tracing: End-to-end visibility across your services
- Performance metrics: CPU, memory, thread locks, contention, and exceptions
- AutoProfile: Continuous profiling for performance optimization (requires .NET Framework 4.7.2 or later)
- OpenTelemetry support: Integrate with existing OTel implementations
How .NET Framework monitoring works
Create any application with .NET Framework 4.5.2 or later or use an existing one. Install the Instana agent in your environment. The agent detects the .NET Framework process and loads the CLR sensor. It automatically collects performance metrics and health data from your .NET Framework applications.
Tracing is automatically enabled for IIS‑hosted applications, while non‑IIS applications require explicit configuration to capture trace data. When the Instana agent starts on your Windows system, it installs the CLR Tracer (tracing extension for .NET Framework) by using the profiling API defined in the .NET Framework. The extension is composed of several files that contain the tracing components. Because Instana uses the Profiling API, it involves COM-Libraries and managed assemblies.
The extension registers a COM-DLL (profiler) with three managed assemblies:
Instana.ManagedTracing.dllInstana.ManagedTracing.Base.dllSystem.Collections.Immutable.dll
After the extension registers the components, Instana updates the Windows registry so that supported application hosts, such as W3SVC or WebSphere Application Server, automatically attach the profiler the next time they start. Instana does not restart these services automatically to prevent interruptions to your services. Existing applications must be restarted manually to activate tracing.
INSTANA_NET_ENABLE_MULTIDOMAIN environment variable to true, which instruments the main application domain (the first loaded domain).Both the CLR sensor and tracer work together to provide complete observability across your .NET Framework applications. For latest sensor and tracer releases, see CLR sensor and CLR Tracer.
Prerequisites
Ensure that the following prerequisites are met:
-
System hardware requirements:
- RAM: 8 GB or more of available memory
- CPU: 4 or more CPU cores for optimal performance
- Disk Space: 100 MB for tracer logs and temporary files
- Instana agent is installed: The host agent must be running on your Windows infrastructure. See Installing agent on Windows.
- InstanaPCP is running: InstanaPCP enables the Instana agent to communicate with your .NET Framework application. To check whether InstanaPCP is running, open Task Manager on Windows and look for
InstanaPCP.exe. - Network connectivity: Your .NET Framework application must reach the Instana agent. For more information, see Network requirements.
- Supported .NET Framework runtime: .NET Framework 4.5.2 or later. See Support information.
Support information
To make sure that Instana is compatible with your current setup, see Supported .NET Framework runtimes and libraries and frameworks.
Setting up .NET Framework monitoring
To set up .NET Framework monitoring, complete the following tasks in order:
Step 1: Verifying agent configuration
The sensor and tracing extensions are enabled by default. When the agent is started, InstanaPCP logs information about the process of trace enablement.
The following example shows the agent configuration.yaml file with .NET Framework tracing enabled:
# .NET Full Framework tracing
com.instana.plugin.clr:
# # Tracing for .NET Full Framework CLR. Enabled by default
tracing:
# # Enabling tracing will instruct the agent to register the IL-rewriting components for .NET
# # alongside with the instrumentation-libraries.
# # It will also set the environment-variables for any IIS hosted .NET applications.
# # Non-IIS hosted applications which you want to trace need these env-vars to be set
# # manually before starting the actual process
# # (see the docs here: https://docs.instana.io/ecosystem/dot-net/#enabling-tracing-for-non-iis-hosted-applications)
enabled: true
instrumentation:
suppressions:
# # The absolute path to a batch-file that should be executed when the tracing-components for
# # NET Full Framework (Windows) have been updated. You can use this script to automate tasks
# # that should be executed when new tracing-components get installed. This usually will be
# # process-restarts or issuing an iisreset command, so that the processes can pickup the new components.
# # The commands issued in the script should be executed asynchronously (start /b <cmd>) in order to not
# # slow down the startup-time of InstanaPCP. In case of long-running synchronous tasks (like iisreset) you might
# # see warnings in the log concerning the unavailability of InstanaPCP for the duration of the execution.
# update_script: <absolute_path_to_batchfile>
# # Memory-limits for InstanaPCP.
# # You can specify these limits to account for high expected load and/or a lot of
# # infrastructure-components being monitored. Values are in mega-bytes.
# pcp_warn_limit: 150
# pcp_stop_limit: 250
Step 2: Selecting platform-specific setup guide
Select the guide that matches your deployment environment:
| Deployment environment | Guide |
|---|---|
| IIS-hosted applications | Setting up .NET Framework tracing on IIS |
| Windows processes and services | Setting up .NET Framework tracing on Windows |
For a comprehensive overview of all setup options, see Setting up .NET Framework tracing.
Step 3: Configuring additional features (optional)
After you have basic monitoring set up, you can configure the following optional features to enhance your .NET Framework monitoring capabilities:
- Custom tracing: Add custom spans using the .NET SDK.
- Ignoring processes: Exclude specific processes from .NET tracing by configuring an environment variable.
- Whitelisting processes: Trace only specific processes.
- Span filtering: Reduce data volume by filtering specific spans.
- AutoProfile: Enable continuous profiling for performance optimization.
For detailed configuration instructions, see Configuring additional features.
Integrating with OpenTelemetry
Instana provides .NET components for integrating with OpenTelemetry, which are described in the page Integrating OpenTelemetry with .NET applications.
Viewing metrics and traces
After you set up monitoring, you can view the metrics and traces that are related to .NET Framework applications in the Instana UI.
To view metrics, complete the following steps:
- From the navigation menu in the Instana UI, select Infrastructure.
- Click a specific monitored host.
You can see a host dashboard with all the collected metrics and monitored processes.
To view traces, complete the following steps:
- From the navigation menu in the Instana UI, click Applications.
- On the Applications dashboard, select a .NET Framework application or service.
- On the application or services dashboard, click Analyze Calls.
- On the Analytics dashboard, select Calls or Traces from the Applications menu.
The following guides provide detailed instructions on how to view the data for your applications:
Configuration data
| Tracked Configuration | Description |
|---|---|
| Name | Name of the application |
| Version | CLR runtime version |
| Arguments | Arguments of the application |
Performance metrics
| Metrics | Description |
|---|---|
| GC Activity | Shows how often and how long the .NET Garbage Collector runs |
| Memory Usage | Reports the amount of memory the application is using |
| Thread-locks | Indicates when threads are blocked waiting for locks |
| Contention | Measures competition between threads for shared resources |
| Exceptions | Displays the number and types of runtime exceptions |
Health signatures
Instana evaluates health signatures continuously against incoming metrics and raises issues or incidents based on user impact.
Built-in events trigger issues or incidents based on failing health signatures on entities, and custom events trigger issues or incidents based on the thresholds of an individual metric of any specific entity.
For information about built-in events for .NET Framework, see Built-in events reference.
InstanaPCP and performance counters
For more information about InstanaPCP and performance counters, see InstanaPCP and Windows performance counters.
Disabling tracing
To disable tracing for .NET Framework applications, complete the following steps:
- Update the configuration file: Open the agent
configuration.yamlfile and set the .NET Framework tracing flag toenabled: false.The following example shows an extract from the
configuration.yamlfile with .NET Framework tracing disabled:# CLR Tracing com.instana.plugin.clr: tracing: enabled: false - Restart the Instana agent so that the updated configuration is applied.
- Restart the host process.
Known issues and limitations
Review the known issues and limitations for .NET Framework tracing:
Library version instrumentation limitations
Instana with CLR Sensor 1.1.148 and .NET Tracer Framework 1.315.1 release (13 March 2026) restricts instrumentation to library versions explicitly listed in the Supported libraries and frameworks for tracing section. Unsupported versions are not instrumented.
To ensure continued support, upgrade to supported versions. For more details and workaround options, see the Technote.
Limited IIS-level metrics for .NET 5 and later applications running in No Managed Code application pools
When an application that is originally built on .NET Framework is migrated to .NET 5 or later (including .NET 6, 7, 8, and later) and hosted on IIS, the application pool must be configured to run with No Managed Code. In this mode, Instana cannot collect IIS‑level metrics.
When an IIS Application Pool is set to No Managed Code, Instana cannot collect the following IIS-level metrics:
- Application Pool names
w3wp.exeprocess metrics- Worker process-level monitoring data
This limitation is inherent to how IIS hosts .NET 5 and later applications. Application‑level instrumentation and tracing continue to work as expected but IIS-level metrics are not available.
If you require IIS-level metrics, consider using .NET Framework 4 or earlier applications, which support managed code Application Pools.
Multi-AppDomain applications
When instrumenting multi-AppDomain applications (such as SharePoint), the System.dll is loaded in multiple or shared AppDomains. However, when Instana tries to instrument the class System.Net.HttpWebRequest class in System.dll, it rewrites methods only in the main app domain, resulting in the following error:
Loading this assembly would produce a different grant set from other instances.
If you encounter this error, set the following environment variables:
INSTANA_REWRITER_SUPPRESSION=System.Net.HttpWebRequest
INSTANA_TRACER_SUPPRESSION_ENABLED=1
When set, rewriting is skipped for System.Net.HttpWebRequest, and the rest of the instrumentation works as expected.
Troubleshooting .NET Framework monitoring
If you encounter issues with .NET Framework monitoring or tracing, troubleshoot as follows:
Common troubleshooting steps
If you don't see traces or metrics in the Instana UI, complete the following general troubleshooting steps:
- Verify prerequisites:
- Ensure that your .NET Framework runtime version is supported (.NET Framework 4.5.2 or later)
- Confirm that the Instana agent is running and accessible
- Verify InstanaPCP is running (check Task Manager for
InstanaPCP.exe) - Check network connectivity between your application and the agent
- Check environment variables:
- Verify that all required environment variables are set correctly
- Ensure that paths are valid and accessible
- Confirm that variable names are spelled correctly
- Verify tracing configuration:
- Check that tracing is enabled in the agent
configuration.yamlfile - Restart the agent and application after configuration changes
- For IIS applications, run
iisresetafter configuration changes
- Check that tracing is enabled in the agent
- Check for conflicting APM tools:
- Verify that no other APM tools are using the same profiling hooks
- Disable other APM agents if present
For detailed platform-specific troubleshooting scenarios and solutions, see the appropriate troubleshooting guide in the following section.
Platform-specific troubleshooting guides
| Deployment environment | Troubleshooting guide |
|---|---|
| IIS-hosted web applications | Troubleshooting .NET Framework tracing on IIS |
| Windows services or stand-alone processes | Troubleshooting .NET Framework tracing on Windows |
For an overview of all troubleshooting options, see Troubleshooting .NET Framework tracing.