From 76c547c05d1985311200e78c6e07237d0050a21c Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Thu, 30 Apr 2026 10:22:45 -0700 Subject: [PATCH 1/3] fix: pass numeric measurements via measures arg in env_selection.completed workspaceFolderCount, resolvedFolderCount, and settingErrorCount were passed as string properties but are numeric measurements. Passing them as string properties causes them to be silently dropped by the telemetry pipeline. Move them to the measures argument so they are recorded. globalScopeDeferred remains a string property (boolean serialized as 'true'/'false') and is unaffected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/telemetry/constants.ts | 5 ++--- src/features/interpreterSelection.ts | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/common/telemetry/constants.ts b/src/common/telemetry/constants.ts index 47e45888..36e1ec4e 100644 --- a/src/common/telemetry/constants.ts +++ b/src/common/telemetry/constants.ts @@ -106,6 +106,8 @@ export enum EventNames { * Duration measures the blocking time (excludes deferred global scope). * Properties: * - globalScopeDeferred: boolean (true = global scope fired in background, false = awaited) + * Measures (sent in the `measures` arg because of `isMeasurement: true` in GDPR): + * - duration: number (ms) * - workspaceFolderCount: number (total workspace folders) * - resolvedFolderCount: number (folders that resolved with a non-undefined env) * - settingErrorCount: number (user-configured settings that could not be applied) @@ -451,9 +453,6 @@ export interface IEventNamePropertyMapping { */ [EventNames.ENV_SELECTION_COMPLETED]: { globalScopeDeferred: boolean; - workspaceFolderCount: number; - resolvedFolderCount: number; - settingErrorCount: number; }; /* __GDPR__ diff --git a/src/features/interpreterSelection.ts b/src/features/interpreterSelection.ts index 24e36061..d6a69be0 100644 --- a/src/features/interpreterSelection.ts +++ b/src/features/interpreterSelection.ts @@ -396,12 +396,20 @@ export async function applyInitialEnvironmentSelection( } // Duration measures blocking time only (excludes deferred global scope). - sendTelemetryEvent(EventNames.ENV_SELECTION_COMPLETED, selectionStopWatch.elapsedTime, { - globalScopeDeferred: workspaceFolderResolved, - workspaceFolderCount: folders.length, - resolvedFolderCount, - settingErrorCount: allErrors.length, - }); + // Numeric values are sent via the measures argument; pass them as properties + // causes them to be dropped by the telemetry pipeline. + sendTelemetryEvent( + EventNames.ENV_SELECTION_COMPLETED, + { + duration: selectionStopWatch.elapsedTime, + workspaceFolderCount: folders.length, + resolvedFolderCount, + settingErrorCount: allErrors.length, + }, + { + globalScopeDeferred: workspaceFolderResolved, + }, + ); } /** From b3ae97a266622919a00a075637682d25201d65b4 Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Mon, 4 May 2026 15:33:56 -0700 Subject: [PATCH 2/3] second telemetry update --- src/common/telemetry/constants.ts | 16 ++++++++-------- src/extension.ts | 11 ++++++++++- src/features/interpreterSelection.ts | 4 +--- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/common/telemetry/constants.ts b/src/common/telemetry/constants.ts index 36e1ec4e..fe9ccb80 100644 --- a/src/common/telemetry/constants.ts +++ b/src/common/telemetry/constants.ts @@ -65,6 +65,9 @@ export enum EventNames { * the timer is cancelled and this event never fires. * Properties: * - failureStage: string (which phase was in progress when the watchdog fired) + * Measures: + * - duration: total elapsed since activation + * - stageDuration: elapsed in the current stage */ SETUP_HANG_DETECTED = 'SETUP.HANG_DETECTED', /** @@ -103,14 +106,10 @@ export enum EventNames { ENV_SELECTION_RESULT = 'ENV_SELECTION.RESULT', /** * Telemetry event fired when applyInitialEnvironmentSelection returns. - * Duration measures the blocking time (excludes deferred global scope). * Properties: - * - globalScopeDeferred: boolean (true = global scope fired in background, false = awaited) - * Measures (sent in the `measures` arg because of `isMeasurement: true` in GDPR): - * - duration: number (ms) - * - workspaceFolderCount: number (total workspace folders) - * - resolvedFolderCount: number (folders that resolved with a non-undefined env) - * - settingErrorCount: number (user-configured settings that could not be applied) + * - globalScopeDeferred: boolean (true = global scope fired in background) + * Measures: + * - duration, workspaceFolderCount, resolvedFolderCount, settingErrorCount */ ENV_SELECTION_COMPLETED = 'ENV_SELECTION.COMPLETED', /** @@ -383,7 +382,8 @@ export interface IEventNamePropertyMapping { /* __GDPR__ "setup.hang_detected": { "failureStage": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "StellaHuang95" }, - "": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "StellaHuang95" } + "": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "StellaHuang95" }, + "": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" } } */ [EventNames.SETUP_HANG_DETECTED]: { diff --git a/src/extension.ts b/src/extension.ts index f635874a..ec8a24cd 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -552,6 +552,7 @@ export async function activate(context: ExtensionContext): Promise { let failureStage = 'nativeFinder'; + const stageWatch = new StopWatch(); // Watchdog: fires if setup hasn't completed within 120s, indicating a likely hang const SETUP_HANG_TIMEOUT_MS = 120_000; let hangWatchdogActive = true; @@ -568,7 +569,11 @@ export async function activate(context: ExtensionContext): Promise Date: Mon, 4 May 2026 15:35:49 -0700 Subject: [PATCH 3/3] update owner --- src/common/telemetry/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/telemetry/constants.ts b/src/common/telemetry/constants.ts index fe9ccb80..e77a2568 100644 --- a/src/common/telemetry/constants.ts +++ b/src/common/telemetry/constants.ts @@ -382,7 +382,7 @@ export interface IEventNamePropertyMapping { /* __GDPR__ "setup.hang_detected": { "failureStage": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "StellaHuang95" }, - "": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "StellaHuang95" }, + "": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" }, "": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" } } */