Added outcome telemetry for cold start (#41200)
* Added outcome telemetry * update format * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Shawn Yuan committed
Aug 5, 2026 at 08:56 UTC
1b76e34cc5d05c2a225d1a4303bca637480dbfd9
1 file changed
+5
-2
src/windows/service/exe/LxssUserSession.cpp
+5
-2
@@ -2569,8 +2569,9 @@ std::shared_ptr<LxssRunningInstance> LxssUserSessionImpl::_CreateInstance(_In_op
2569
TraceLoggingValue(instanceId, "instanceId"));
2570
2571
HRESULT result = E_UNEXPECTED;
2572
-
2572
+ wsl::windows::common::wslutil::StopWatch stopWatch;
2573
auto createEnd = wil::scope_exit_log(WI_DIAGNOSTICS_INFO, [&] {
2574
+ const auto& reportedError = context.ReportedError();
2575
WSL_LOG_TELEMETRY(
2576
"CreateInstanceEnd",
2577
PDT_ProductAndServicePerformance,
@@ -2578,7 +2579,9 @@ std::shared_ptr<LxssRunningInstance> LxssUserSessionImpl::_CreateInstance(_In_op
2579
TraceLoggingValue(version, "version"),
2580
TraceLoggingValue(instanceId, "instanceId"),
2581
TraceLoggingValue(SUCCEEDED(result), "success"),
2581
- TraceLoggingValue(result, "error"));
2582
+ TraceLoggingValue(result, "error"),
2583
+ TraceLoggingValue(reportedError ? reportedError->Context : 0ULL, "errorContext"),
2584
+ TraceLoggingValue(stopWatch.ElapsedMilliseconds(), "CreationTimeMs"));
2585
});
2586
2587
try