Fix WSLc telemetry to fire critical events (#40754)
* Updated wslc telemetry
Craig Loewen committed
Jun 9, 2026 at 17:53 UTC
2b7ce691323b42a3743120763d259f63a933ab5b
2 files changed
+6
-4
src/windows/service/exe/WSLCSessionManager.cpp
+3
-2
@@ -322,11 +322,12 @@ void WSLCSessionManagerImpl::CreateSession(
322
});
323
324
// This telemetry event is used to keep track of session creation performance (via CreationTimeMs) and failure reasons (via Result).
325
- WSL_LOG_TELEMETRY(
325
+ WSL_LOG(
326
"WSLCCreateSession",
327
- PDT_ProductAndServicePerformance,
327
+ TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
328
TraceLoggingKeyword(MICROSOFT_KEYWORD_CRITICAL_DATA),
329
TraceLoggingValue(resolvedDisplayName.c_str(), "Name"),
330
+ TraceLoggingValue(WSL_PACKAGE_VERSION, "wslVersion"),
331
TraceLoggingValue(stopWatch.ElapsedMilliseconds(), "CreationTimeMs"),
332
TraceLoggingValue(creationResult, "Result"),
333
TraceLoggingValue(tokenInfo.Elevated, "Elevated"),
src/windows/wslcsession/WSLCSession.cpp
+3
-2
@@ -1699,11 +1699,12 @@ try
1699
auto result = wil::ResultFromException([&]() { CreateContainerImpl(containerOptions, Container); });
1700
1701
// This telemetry event is used to keep track of the container creation failure rate and surface unexpected errors.
1702
- WSL_LOG_TELEMETRY(
1702
+ WSL_LOG(
1703
"WSLCCreateContainer",
1704
- PDT_ProductAndServicePerformance,
1704
+ TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
1705
TraceLoggingKeyword(MICROSOFT_KEYWORD_CRITICAL_DATA),
1706
TraceLoggingValue(result, "Result"),
1707
+ TraceLoggingValue(WSL_PACKAGE_VERSION, "wslVersion"),
1708
TraceLoggingValue(containerOptions->Image, "Image"),
1709
TraceLoggingValue(m_displayName.c_str(), "SessionName"),
1710
TraceLoggingValue(m_creatorProcessName.c_str(), "CreatorProcess"));