Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions src/common/telemetry/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,27 +601,10 @@ export interface IEventNamePropertyMapping {
"<duration>": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" }
}
*/
// Numeric fields declared in the GDPR block are sent through the measurements payload.
[EventNames.PET_REFRESH]: {
result: 'success' | 'timeout' | 'error';
envCount?: number;
/** Number of discovered environments whose kind is Conda. Lets us slice refresh duration by conda footprint. */
condaEnvCount?: number;
/** Number of discovered environment managers (conda/pyenv/poetry/etc.). */
managerCount?: number;
unresolvedCount?: number;
workspaceDirCount?: number;
searchPathCount?: number;
attempt: number;
errorType?: string;
// breakdown* fields go through the measures payload (numeric); listed here for GDPR only.
/** ms in the Locators phase. */
breakdownLocators?: number;
/** ms walking PATH env var entries (not a file path). */
breakdownPathEnv?: number;
/** ms scanning global virtual-env dirs. */
breakdownGlobalVirtualEnvs?: number;
/** ms scanning workspace dirs. */
breakdownWorkspaces?: number;
/** JSON-serialized Record<locatorName, ms>. Parse with parse_json() in Kusto. */
locatorsJson?: string;
/** PET crate version reported by the `info` RPC. 'unknown' if the call failed or the PET binary doesn't implement it. */
Comment thread
karthiknadig marked this conversation as resolved.
Expand All @@ -638,14 +621,14 @@ export interface IEventNamePropertyMapping {
"workspaceDirCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" },
"envDirCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" },
"retryCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" },
"errorType": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "eleanorjboyd" },
"<duration>": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" }
}
*/
// Numeric fields declared in the GDPR block are sent through the measurements payload.
[EventNames.PET_CONFIGURE]: {
result: 'success' | 'timeout' | 'error' | 'skipped';
workspaceDirCount?: number;
envDirCount?: number;
retryCount: number;
errorType?: string;
};

/* __GDPR__
Expand All @@ -660,8 +643,8 @@ export interface IEventNamePropertyMapping {
"<duration>": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" }
}
*/
// `attempt` is declared in the GDPR block and sent through the measurements payload.
[EventNames.PET_PROCESS_RESTART]: {
attempt: number;
result: 'success' | 'error';
errorType?: string;
/**
Expand Down
15 changes: 14 additions & 1 deletion src/common/telemetry/errorClassifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export type DiscoveryErrorType =
| 'command_failed'
| 'connection_error'
| 'rpc_error'
| 'rpc_timeout'
| 'rpc_configure_timeout'
| 'rpc_refresh_timeout'
| 'rpc_resolve_timeout'
| 'process_crash'
| 'already_registered'
| 'unknown';
Expand All @@ -27,7 +31,16 @@ export function classifyError(ex: unknown): DiscoveryErrorType {
}

if (ex instanceof RpcTimeoutError) {
return 'spawn_timeout';
switch (ex.method) {
case 'configure':
return 'rpc_configure_timeout';
case 'refresh':
return 'rpc_refresh_timeout';
case 'resolve':
return 'rpc_resolve_timeout';
default:
return 'rpc_timeout';
}
}

// JSON-RPC connection errors (e.g., PET process died mid-request, connection closed/disposed)
Expand Down
Loading