-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundled Tracer fails to load with .NET 8 and COMPlus_EnableDiagnostics=0 #5030
Comments
I just realized that the linked logs are apparently private, so here is what I get: ✅ .NET 7 COMPlus_EnableDiagnostics=0
✅ .NET 7 COMPlus_EnableDiagnostics unset
❌ .NET 8 COMPlus_EnableDiagnostics=0
Note the lines:
✅ .NET 8 COMPlus_EnableDiagnostics unset
|
Hi @marcovr, thanks for flagging this. It appears that this was a behavior change in .NET 8 which disables the profiling APIs we rely on when you set Unfortunately, as it's in the runtime, there's nothing we can do about it, however they suggest the following workaround:
Could you give that a try and make sure that fixes your issue? Thanks! |
Ohh I see. Not your fault then 😉 But maybe it could be worth adding a note in the Readme / setup documentation about this change? |
Yep, makes sense - will look at getting that added somewhere - thanks! 🙂 |
Having DOTNET_EnableDiagnostics=1 though prevents the use of read-only root filesystem for dotnet containers. Any work-around for having dotnet, read-only root filesystem, AND datadog tracing all at the same time? |
@nwesoccer that was the reason why we had originally set it to 0 as well 😄 But if you set all the following environment variables, it does indeed work with a readonly filesystem because no IPC files are written:
See the corresponding docs |
@marcovr I'm sorry, my test scenario was dotnet 7 as we have projects with both 7 and 8. I suppose that means for dotnet 7 we'll need DOTNET_EnableDiagnostics=0 (since the above list doesn't work with dotnet 7 and read-only) and for dotnet 8 the above mentioned list does work for dotnet8 and read-only? |
Yes, exactly. We solved this by building customized base images where depending on the .NET version, a different set of variables is set. |
@marcovr Makes sense, Thanks!! |
Just FYI, we've added detection of this scenario to the Out of interest though @marcovr/@nwesoccer why are you setting |
Cool, thanks 🙂 The reason why we had set When running any .NET application on a read only file system without this variable set, the runtime fails to start and produces the following output:
I suppose this happens because the runtime fails creating the debug pipes. Interestingly though, this appears to have been fixed with .NET 8. |
Describe the bug
While upgrading our applications to .NET 8 we experienced missing Traces and APM metrics. We then found out that the bundled tracer fails to load / attach to the .NET process when running with .NET 8 and having the environment variable
COMPlus_EnableDiagnostics=0
set.To Reproduce
Steps to reproduce the behavior:
Have a look at my minimal reproducible repo
As you can see in this run, the bundled tracer is successfully loaded with .NET 7 regardless whether
COMPlus_EnableDiagnostics=0
is set or not. But with .NET 8 it fails to load withCOMPlus_EnableDiagnostics=0
:Note: the lines "[FAILURE]: Error connecting to Agent" can be ignored - That is expected because I'm not running an agent :-)
Expected behavior
The tracer works with
COMPlus_EnableDiagnostics=0
ScreenshotsVisualizationCOMPlus_EnableDiagnostics=1
COMPlus_EnableDiagnostics=0
Runtime environment (please complete the following information):
Datadog.Trace.Bundle
Additional context
I only tested this in a containerized environment, but assume that other environments are also affected
The text was updated successfully, but these errors were encountered: