@@ -60,11 +60,12 @@ export enum EventNames {
6060 */
6161 MANAGER_REGISTRATION_FAILED = 'MANAGER_REGISTRATION.FAILED' ,
6262 /**
63- * Telemetry event fired when the setup block appears to be hung.
64- * A watchdog timer fires after a deadline; if the setup completes normally,
65- * the timer is cancelled and this event never fires.
63+ * Watchdog event fired when setup appears hung. Cancelled if setup completes normally.
6664 * Properties:
67- * - failureStage: string (which phase was in progress when the watchdog fired)
65+ * - failureStage: which phase was in progress when the watchdog fired
66+ * - globalScopeDeferred: distinguishes a real foreground hang from the benign 120s
67+ * background global-scope scan. String union (not boolean) because the sender drops
68+ * undefined. Values: 'deferred' | 'not_deferred' | 'unknown'.
6869 * Measures:
6970 * - duration: total elapsed since activation
7071 * - stageDuration: elapsed in the current stage
@@ -86,6 +87,14 @@ export enum EventNames {
8687 * - errorType: string (classified error category, on failure only)
8788 */
8889 PET_INIT_DURATION = 'PET.INIT_DURATION' ,
90+ /**
91+ * Fired once per activation. Lets us slice every other PET event by which binary
92+ * version was running — important since PET evolves independently of the extension.
93+ * Properties:
94+ * - version: output of `pet --version` (e.g. '0.1.0'), or 'unknown' on failure/timeout
95+ * - source: 'envs_extension' | 'python_extension' — which extension shipped the binary
96+ */
97+ PET_VERSION = 'PET.VERSION' ,
8998 /**
9099 * Telemetry event fired when applyInitialEnvironmentSelection begins.
91100 * Signals that all managers are registered and env selection is starting.
@@ -146,12 +155,16 @@ export enum EventNames {
146155 * Telemetry event for a PET refresh attempt (the core discovery RPC call).
147156 * Properties:
148157 * - result: 'success' | 'timeout' | 'error'
149- * - envCount: number (environments returned via notifications)
150- * - unresolvedCount: number (envs that needed follow-up resolve calls)
151- * - workspaceDirCount: number (workspace directories sent in configure)
152- * - searchPathCount: number (extra search paths sent in configure)
153- * - attempt: number (0 = first try, 1 = retry)
154- * - errorType: string (classified error category, on failure only)
158+ * - envCount, unresolvedCount, workspaceDirCount, searchPathCount: number
159+ * - attempt: 0 = first try, 1 = retry
160+ * - errorType: classified error category, on failure only
161+ * - locatorsJson: JSON-serialized Record<locatorName, ms>. Locator set is platform-dependent
162+ * so a flat blob is more practical than a fixed schema. Parse with parse_json() in Kusto.
163+ * Measures (numeric; phases run in parallel so sum may exceed total wall-clock):
164+ * - breakdownLocators: ms in locator plugins
165+ * - breakdownPathEnv: ms scanning PATH env var entries (not a file path)
166+ * - breakdownGlobalVirtualEnvs: ms scanning global virtualenv dirs
167+ * - breakdownWorkspaces: ms scanning workspace dirs
155168 */
156169 PET_REFRESH = 'PET.REFRESH' ,
157170 /**
@@ -166,9 +179,15 @@ export enum EventNames {
166179 /**
167180 * Telemetry event for PET process restart attempts.
168181 * Properties:
169- * - attempt: number ( 1-based restart attempt number)
182+ * - attempt: 1-based restart attempt number
170183 * - result: 'success' | 'error'
171- * - errorType: string (classified error category, on failure only)
184+ * - errorType: classified error category, on failure only
185+ * - triggerReason: why the restart was needed (lets us separate crashes from
186+ * timeout-induced kills; the most specific reason wins — rpc_* recorded before a
187+ * kill is not overwritten by the subsequent exit event). Values:
188+ * rpc_connection_error | rpc_resolve_timeout | rpc_refresh_timeout |
189+ * rpc_configure_timeout | process_exit:<code>:<signal> | process_error |
190+ * start_failed | unknown
172191 */
173192 PET_PROCESS_RESTART = 'PET.PROCESS_RESTART' ,
174193 /**
@@ -391,12 +410,20 @@ export interface IEventNamePropertyMapping {
391410 /* __GDPR__
392411 "setup.hang_detected": {
393412 "failureStage": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "StellaHuang95" },
413+ "globalScopeDeferred": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
394414 "<duration>": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" },
395415 "<stageDuration>": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" }
396416 }
397417 */
398418 [ EventNames . SETUP_HANG_DETECTED ] : {
399419 failureStage : string ;
420+ /**
421+ * Distinguishes a real foreground hang from the benign 120s background global-scope scan.
422+ * - 'deferred': workspace env resolved; global scope ran in background.
423+ * - 'not_deferred': no workspace env; global scope was awaited as primary fallback.
424+ * - 'unknown': hang fired before env-selection reached the global-scope decision.
425+ */
426+ globalScopeDeferred : 'deferred' | 'not_deferred' | 'unknown' ;
400427 } ;
401428
402429 /* __GDPR__
@@ -422,6 +449,19 @@ export interface IEventNamePropertyMapping {
422449 errorType ?: string ;
423450 } ;
424451
452+ /* __GDPR__
453+ "pet.version": {
454+ "version": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
455+ "source": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" }
456+ }
457+ */
458+ [ EventNames . PET_VERSION ] : {
459+ /** Version string reported by `pet --version` (e.g. '0.1.0'), or 'unknown' if the lookup failed. */
460+ version : string ;
461+ /** Which extension shipped the PET binary that's being used. */
462+ source : 'envs_extension' | 'python_extension' ;
463+ } ;
464+
425465 /* __GDPR__
426466 "env_selection.started": {
427467 "registeredManagerCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" },
@@ -515,6 +555,11 @@ export interface IEventNamePropertyMapping {
515555 "searchPathCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" },
516556 "attempt": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" },
517557 "errorType": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
558+ "breakdownLocators": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true, "owner": "eleanorjboyd" },
559+ "breakdownPathEnv": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true, "owner": "eleanorjboyd" },
560+ "breakdownGlobalVirtualEnvs": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true, "owner": "eleanorjboyd" },
561+ "breakdownWorkspaces": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true, "owner": "eleanorjboyd" },
562+ "locatorsJson": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "eleanorjboyd" },
518563 "<duration>": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" }
519564 }
520565 */
@@ -526,6 +571,17 @@ export interface IEventNamePropertyMapping {
526571 searchPathCount ?: number ;
527572 attempt : number ;
528573 errorType ?: string ;
574+ // breakdown* fields go through the measures payload (numeric); listed here for GDPR only.
575+ /** ms in the Locators phase. */
576+ breakdownLocators ?: number ;
577+ /** ms walking PATH env var entries (not a file path). */
578+ breakdownPathEnv ?: number ;
579+ /** ms scanning global virtual-env dirs. */
580+ breakdownGlobalVirtualEnvs ?: number ;
581+ /** ms scanning workspace dirs. */
582+ breakdownWorkspaces ?: number ;
583+ /** JSON-serialized Record<locatorName, ms>. Parse with parse_json() in Kusto. */
584+ locatorsJson ?: string ;
529585 } ;
530586
531587 /* __GDPR__
@@ -549,13 +605,22 @@ export interface IEventNamePropertyMapping {
549605 "attempt": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" },
550606 "result": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
551607 "errorType": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
608+ "triggerReason": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
552609 "<duration>": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" }
553610 }
554611 */
555612 [ EventNames . PET_PROCESS_RESTART ] : {
556613 attempt : number ;
557614 result : 'success' | 'error' ;
558615 errorType ?: string ;
616+ /**
617+ * Why the restart was needed. The most specific reason wins (an rpc_* value recorded
618+ * before the kill is not overwritten by the subsequent exit/error event).
619+ * Values: rpc_connection_error | rpc_resolve_timeout | rpc_refresh_timeout |
620+ * rpc_configure_timeout | process_exit:<code>:<signal> | process_error |
621+ * start_failed | unknown.
622+ */
623+ triggerReason : string ;
559624 } ;
560625
561626 /* __GDPR__
0 commit comments