.NET APM on Linux
  • 03 Dec 2020
  • 1 Minute To Read
  • Contributors
  • Print
  • Share
  • Dark
    Light

.NET APM on Linux

  • Print
  • Share
  • Dark
    Light

Retrace supports .NET applications with multiple Linux distros. Please see the list of supported technologies to ensure your distro is supported.

1. Install the Stackify Linux Agent

Install the latest Stackify Linux Agent on the device that will be executing the application.

Installation Instructions

2. Set the Environment Variables Required by the Profiler

The .NET CLR requires environment variables to be set in order to load a profiler into a process. There are several ways to set these environment variables. Here is an example that only needs to be set once and will be available to each new process that loads without any additional steps.

  1. Open environment from the command-line
    sudo nano /etc/environment
    
  2. Add the environment variables
    CORECLR_PROFILER={cf0d821e-299b-5307-a3d8-b283c03916da}
    CORECLR_ENABLE_PROFILING=1
    CORECLR_PROFILER_PATH="/usr/local/stackify/stackify-dotnet-apm/StackifyProfiler.so"
    
Configuring for systemd
If you are running your .NET Core application within systemd, you will need to modify conf file for your job.
  1. Save & Exit

3. Enable & Configure Your Application

Configuration must be set in Stackify.json in your application folder for proper coordination with Retrace. The existance of this file is used to tell the profiler to profile it. If these values are not present or are duplicated, it may prevent your data from displaying in Retrace.

  1. AppName - this value determines the name of the app displayed in Retrace.
  2. Environment - this value determines the name of the environment for the app displayed in Retrace.

Here's an example of a config file using json:

{
    "AppName": "MyApp",
    "Environment": "MyEnvironment"
}

4. Deploy and Launch Your Application

Note
Applications profiled will only display under Other Apps in Retrace.

Trace data will be automatically processed by the Linux Agent and submitted to Retrace.


Troubleshooting

Profiler debug logging will be written here:

/usr/local/stackify/stackify-dotnet-apm/debug/

Stackify Linux Agent Logs can be found here:

/usr/local/stackify/stackify-agent/log/

Trace data will be written here:

/usr/local/stackify/stackify-dotnet-apm/log/
Was This Article Helpful?