Setting up .NET Framework tracing on Windows

You can set up .NET Framework tracing on Windows systems for stand-alone applications, processes, and Windows Services by manually configuring environment variables. This method is required for non-IIS hosted applications.

This topic covers the following:

Before you begin

To set up .NET Framework tracing on Windows, complete the following steps:

  • Ensure that the Instana agent is running on the host machine. See Installing agent on Windows.
  • Verify that InstanaPCP is running on the host machine. 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.
  • Verify that your application runs on .NET Framework 4.5.2 or later.
  • Review support information.

Enabling tracing for stand-alone applications

The Instana agent does not enable tracing for all .NET-based applications automatically. For example, Windows system applications or stand-alone processes are excluded unless explicitly configured.

IIS and WebSphere Application Server are configured to attach the profiler automatically by setting appropriate environment variables. However, stand-alone processes must be configured manually.

To enable tracing for a process, set the following environment variables:

Note:
  • If you use specific users to run your applications, set the environment variables at the user level.
  • Set the environment variables before you start the process.
SET COR_ENABLE_PROFILING=1
SET COR_PROFILER={FA8F1DFF-0B62-4F84-887F-ECAC69A65DD3}

You can put these settings into a batch or shell script that sets the environment variables and then starts your process.

Enabling tracing for Windows Services

If you are running Windows Services, you can add environment variable settings into the registry on a per-service basis. Adding these settings gives you better control on choosing the services to trace.

To set up the environment variable for Windows Services, complete the following steps:

  1. Go to the Registry Editor in the HKLM\System\CurrentControlSet\Services\serviceName directory.
  2. Add the MULTI_SZ value with the name, Environment.
  3. If MULTI_SZ does not exist, copy the variables COR_ENABLE_PROFILING, COR_PROFILER, and INSTANA_ALLOW_ROOT_EXIT_SPAN into that value.
  4. To set the contents of a MULTI_SZ value, add one key-value pair per line as shown in the following example:
    COR_ENABLE_PROFILING=1
    COR_PROFILER={FA8F1DFF-0B62-4F84-887F-ECAC69A65DD3}
    INSTANA_ALLOW_ROOT_EXIT_SPAN=1
  5. After the last line, press Enter.
  6. Restart the Windows Service for the changes to take effect.