-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
DOTNET_EnableDiagnostics=0 disables profiling in .NET 8 #96227
Comments
Tagging subscribers to this area: @tommcdon Issue DetailsDescriptionIt appears that setting I'm an engineer on New Relic's .NET agent team and this issue was brought to our attention by a customer who observed that our agent (which is a profiler) stopped working for them in .NET 8 when they had Reproduction StepsSee the attached repro: EnableDiagnosticsDemo2.zip This Docker project adds the New Relic .NET agent to a sample webapi project and configures our profiling environment variables. The entrypoint is a script that runs the app and then checks to see if any New Relic log files have been created. If log files are created, the profiler is working as expected. If no log files are created, profiling is broken. A line is printed with the results. By running the repro with and without
Expected behaviorSimilar behavior to .NET 7 where setting I checked to see if this behavior change was announced here: https://learn.microsoft.com/en-us/dotnet/core/compatibility/8.0 Actual behaviorSetting Regression?This is a behavior change from .NET 7 to .NET 8. Known WorkaroundsNo response ConfigurationSee the Dockerfile in the repro project. I have reproduced this issue on Windows 11 (x64) as well as in the Debian docker container. Other informationNo response
|
Hi @nr-ahemsath! I apologize for the oversight in our breaking change documentation. I agree our documentation should be clearer - As you have correctly pointed out, in .NET 8 we added new configuration knobs that will allow you to more granularly enable/disable diagnostics:
To emulate previous behavior, I suggest setting the following to ensure the behavior is as intended: export DOTNET_EnableDiagnostics=1
export DOTNET_EnableDiagnostics_IPC=0
export DOTNET_EnableDiagnostics_Debugger=0
export DOTNET_EnableDiagnostics_Profiler=1 I'll mark this issue as a documentation bug. Hope this helps! Thanks for reporting the issue! |
@tommcdon Thanks for the quick response, I'll let our customer know what the workaround is. |
Description
It appears that setting
DOTNET_EnableDiagnostics=0
(orCOMPlus_EnableDiagnostics=0
) disables profiling in .NET 8. This is a behavior change from .NET 7. I believe what causes this are the changes in this PR: #90159I'm an engineer on New Relic's .NET agent team and this issue was brought to our attention by a customer who observed that our agent (which is a profiler) stopped working for them in .NET 8 when they had
COMPlus_EnableDiagnostics
set to 0.Reproduction Steps
See the attached repro: EnableDiagnosticsDemo2.zip
This Docker project adds the New Relic .NET agent to a sample webapi project and configures our profiling environment variables. The entrypoint is a script that runs the app and then checks to see if any New Relic log files have been created. If log files are created, the profiler is working as expected. If no log files are created, profiling is broken. A line is printed with the results. By running the repro with and without
DOTNET_EnableDiagnostics
set to 0, you can see the behavior difference:Expected behavior
Similar behavior to .NET 7 where setting
DOTNET_EnableDiagnostics=0
doesn't disable profiling.I checked to see if this behavior change was announced here: https://learn.microsoft.com/en-us/dotnet/core/compatibility/8.0
but I didn't see anything at first glance. My understanding of the PR I linked in the description is to give customers finer-grained controls over what aspects of .NET runtime diagnostics to enable or disable, but it looks like it also makes it so the generic
DOTNET_EnableDiagnostics
disables/enables all three (profiling, debugging, and IPC), which it previously did not do.Actual behavior
Setting
DOTNET_EnableDiagnostics=0
disables profiling in .NET 8.Regression?
This is a behavior change from .NET 7 to .NET 8.
Known Workarounds
No response
Configuration
See the Dockerfile in the repro project. I have reproduced this issue on Windows 11 (x64) as well as in the Debian docker container.
Other information
No response
The text was updated successfully, but these errors were encountered: