apm-agent-dotnet icon indicating copy to clipboard operation
apm-agent-dotnet copied to clipboard

[BUG] Auto-instrumentation using the profiler-based agent installation fails inside Docker containers since 1.23.0

Open stevejgordon opened this issue 1 year ago • 5 comments

When building a container image containing the profiler agent for auto-instrumentation of ASP.NET Core applications, the agent is no longer working. No logs appear from the profiler, suggesting that this fails extremely early when the CLR attempts to load the profiler. We see no obvious logs from the .NET runtime to identify the reason for the failure.

We need to identify what changed between 1.22.0 and 1.23.0 that may have caused this. No obvious changes were made to the managed profiler code.

stevejgordon avatar Jun 27 '24 10:06 stevejgordon

I've included a sample that can be used to reproduce this by building images for various combinations of agent version and .NET runtime. The README contains details of the steps to use it.

stevejgordon avatar Jun 28 '24 11:06 stevejgordon

After testing this in several combinations, the latest agent seems to work on a .NET 8.0 container.

Runtime Version Agent Version Working (Y/N)
8.0 1.27.3 Y
7.0 1.27.3 N
6.0 1.27.3 N
8.0 1.22.0 Y
7.0 1.22.0 Y
6.0 1.22.0 Y
6.0 1.23.0 N
6.0 Custom local build N

stevejgordon avatar Jun 28 '24 11:06 stevejgordon

As yet untested in Linux outside of a container scenario.

stevejgordon avatar Jun 28 '24 11:06 stevejgordon

On initial testing on a Debian 11 VM, 1.27.3 failed on .NET 6.0 and .NET 8.0. This is strange, as I had it working in a container. 1.22.0 seemed to work fine.

stevejgordon avatar Jul 02 '24 08:07 stevejgordon

We have identified the root cause and hope to have a fix soon.

stevejgordon avatar Jul 02 '24 12:07 stevejgordon