From e94a4c3e264667306eab67959328866ed56f5b42 Mon Sep 17 00:00:00 2001 From: Kevin Gosse Date: Mon, 14 Oct 2024 18:17:51 +0200 Subject: [PATCH] [Crashtracking] Disable crashtracking on Windows by default (#6152) ## Summary of changes Disable crashtracking on Windows by default. ## Reason for change The next version of the tracer will be released before we implement proper support for the PDBs in crashtracking, so change it to opt-in for now (effectively disabling it since nobody is going to manually enable it). ## Implementation details Changed the default value of `DD_CRASHTRACKING_ENABLED`. ## Test coverage Had to update the tests to account for the new default value on Windows. --- shared/src/Datadog.Trace.ClrProfiler.Native/dllmain.cpp | 2 +- .../CreatedumpTests.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/shared/src/Datadog.Trace.ClrProfiler.Native/dllmain.cpp b/shared/src/Datadog.Trace.ClrProfiler.Native/dllmain.cpp index 70ee30f937c9..f0856ca62f6c 100644 --- a/shared/src/Datadog.Trace.ClrProfiler.Native/dllmain.cpp +++ b/shared/src/Datadog.Trace.ClrProfiler.Native/dllmain.cpp @@ -80,7 +80,7 @@ EXTERN_C BOOL STDMETHODCALLTYPE DllMain(HMODULE hModule, DWORD ul_reason_for_cal bool telemetry_enabled = true; shared::TryParseBooleanEnvironmentValue(shared::GetEnvironmentValue(L"DD_INSTRUMENTATION_TELEMETRY_ENABLED"), telemetry_enabled); - bool crashtracking_enabled = true; + bool crashtracking_enabled = false; shared::TryParseBooleanEnvironmentValue(shared::GetEnvironmentValue(L"DD_CRASHTRACKING_ENABLED"), crashtracking_enabled); if (telemetry_enabled && crashtracking_enabled) diff --git a/tracer/test/Datadog.Trace.Tools.dd_dotnet.ArtifactTests/CreatedumpTests.cs b/tracer/test/Datadog.Trace.Tools.dd_dotnet.ArtifactTests/CreatedumpTests.cs index 16ff5a735ab7..0d48cd291a5e 100644 --- a/tracer/test/Datadog.Trace.Tools.dd_dotnet.ArtifactTests/CreatedumpTests.cs +++ b/tracer/test/Datadog.Trace.Tools.dd_dotnet.ArtifactTests/CreatedumpTests.cs @@ -35,6 +35,11 @@ public CreatedumpTests(ITestOutputHelper output) SetEnvironmentVariable("COMPlus_DbgMiniDumpType", string.Empty); SetEnvironmentVariable("COMPlus_DbgEnableMiniDump", string.Empty); SetEnvironmentVariable("DD_INSTRUMENTATION_TELEMETRY_ENABLED", string.Empty); + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + SetEnvironmentVariable("DD_CRASHTRACKING_ENABLED", "1"); + } } private static (string Key, string Value) LdPreloadConfig