Failure to Initialize Chained Profiler with .NET Core Agent

How to resolve an issue when a .NET profiler chained with the Agent appears not to work with an application.

Summary

  • Category: Agent operation
  • Environment: Linux
  • Severity/Impact: Critical: chained profiler doesn't work
  • Status: Known issue
  • Impacted versions: All

Symptoms

The configured chained profiler appears not to work with the application, while the Agent is working. An error message Initialize chaining profiler get ‘DllGetClassObject' failed: dotnet: undefined symbol: DllGetClassObject appears in the Agent’s logs.

Cause

The Seeker .NET Core Agent profiler is loaded first and prevents the chained profiler from loading correctly.

Resolution

To ensure that the chained profiler loads before the Agent, prepend the chained profiler's .so file path to the LD_PRELOAD environment variable: export LD_PRELOAD=/other/agent/lib.agent.so:${LD_PRELOAD}

Your application's startup script that enables the .NET Core Agent with profiler chaining would look similar to the following:
# Enable the  Seeker .NET Core Agent
export CORECLR_ENABLE_PROFILING='1'
export CORECLR_PROFILER='{C7AD49B3-093B-4AB1-A241-1E4365DD8901}'
export CORECLR_PROFILER_PATH='/seeker/agent/Agent.Profiler-Dnc/build/musl-x64/Agent.Profiler-Dnc.Core.so'
export SEEKER_SERVER_URL='https://seekerserver/'

# Enable profiler chaining for the Agent
export SEEKER_DN_CORE_PROFILER_CHAINING='{7B527C21-F13E-43C1-BEEE-26F92B89DC30}'
export SEEKER_DN_CORE_PROFILER_PATH_CHAINING='/other/agent/lib.agent.so'

# Ensure that the chained profiler loads before the Agent
export LD_PRELOAD=/other/agent/lib.agent.so:${LD_PRELOAD}

# Start the application
dotnet exec /app/MyApplication.dll