Skip to content

Commit d8ae575

Browse files
authored
Add more data for conda envs not found (#23770)
1 parent 5470d60 commit d8ae575

File tree

2 files changed

+65
-15
lines changed

2 files changed

+65
-15
lines changed

src/client/pythonEnvironments/base/locators/common/nativePythonTelemetry.ts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,34 @@ export type NativePythonTelemetry = MissingCondaEnvironments;
1010
export type MissingCondaEnvironments = {
1111
event: 'MissingCondaEnvironments';
1212
data: {
13-
missing: number;
14-
userProvidedCondaExe?: boolean;
15-
rootPrefixNotFound?: boolean;
16-
condaPrefixNotFound?: boolean;
17-
condaManagerNotFound?: boolean;
18-
sysRcNotFound?: boolean;
19-
userRcNotFound?: boolean;
20-
otherRcNotFound?: boolean;
21-
missingEnvDirsFromSysRc?: number;
22-
missingEnvDirsFromUserRc?: number;
23-
missingEnvDirsFromOtherRc?: number;
24-
missingFromSysRcEnvDirs?: number;
25-
missingFromUserRcEnvDirs?: number;
26-
missingFromOtherRcEnvDirs?: number;
13+
missingCondaEnvironments: {
14+
missing: number;
15+
envDirsNotFound?: number;
16+
userProvidedCondaExe?: boolean;
17+
rootPrefixNotFound?: boolean;
18+
condaPrefixNotFound?: boolean;
19+
condaManagerNotFound?: boolean;
20+
sysRcNotFound?: boolean;
21+
userRcNotFound?: boolean;
22+
otherRcNotFound?: boolean;
23+
missingEnvDirsFromSysRc?: number;
24+
missingEnvDirsFromUserRc?: number;
25+
missingEnvDirsFromOtherRc?: number;
26+
missingFromSysRcEnvDirs?: number;
27+
missingFromUserRcEnvDirs?: number;
28+
missingFromOtherRcEnvDirs?: number;
29+
};
2730
};
2831
};
2932

3033
export function sendNativeTelemetry(data: NativePythonTelemetry): void {
3134
switch (data.event) {
3235
case 'MissingCondaEnvironments': {
33-
sendTelemetryEvent(EventName.NATIVE_FINDER_MISSING_CONDA_ENVS, undefined, data.data);
36+
sendTelemetryEvent(
37+
EventName.NATIVE_FINDER_MISSING_CONDA_ENVS,
38+
undefined,
39+
data.data.missingCondaEnvironments,
40+
);
3441
break;
3542
}
3643
default: {

src/client/telemetry/index.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,7 @@ export interface IEventNamePropertyMapping {
14021402
/* __GDPR__
14031403
"native_finder_missing_conda_envs" : {
14041404
"missing" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "donjayamanne" },
1405+
"envDirsNotFound" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "donjayamanne" },
14051406
"userProvidedCondaExe" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
14061407
"rootPrefixNotFound" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
14071408
"condaPrefixNotFound" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
@@ -1419,21 +1420,63 @@ export interface IEventNamePropertyMapping {
14191420
* Number of missing conda environments.
14201421
*/
14211422
missing: number;
1423+
/**
1424+
* Total number of env_dirs not found even after parsing the conda_rc files.
1425+
* This will tell us that we are either unable to parse some of the conda_rc files or there are other
1426+
* env_dirs that we are not able to find.
1427+
*/
1428+
envDirsNotFound?: number;
14221429
/**
14231430
* Whether a conda exe was provided by the user.
14241431
*/
14251432
userProvidedCondaExe?: boolean;
1433+
/**
1434+
* Whether the user provided a conda executable.
1435+
*/
14261436
rootPrefixNotFound?: boolean;
1437+
/**
1438+
* Whether the conda prefix returned by conda was not found by us.
1439+
*/
14271440
condaPrefixNotFound?: boolean;
1441+
/**
1442+
* Whether we found a conda manager or not.
1443+
*/
14281444
condaManagerNotFound?: boolean;
1445+
/**
1446+
* Whether we failed to find the system rc path.
1447+
*/
14291448
sysRcNotFound?: boolean;
1449+
/**
1450+
* Whether we failed to find the user rc path.
1451+
*/
14301452
userRcNotFound?: boolean;
1453+
/**
1454+
* Number of config files (excluding sys and user rc) that were not found.
1455+
*/
14311456
otherRcNotFound?: boolean;
1457+
/**
1458+
* Number of conda envs that were not found by us, and the envs belong to env_dirs in the sys config rc.
1459+
*/
14321460
missingEnvDirsFromSysRc?: number;
1461+
/**
1462+
* Number of conda envs that were not found by us, and the envs belong to env_dirs in the user config rc.
1463+
*/
14331464
missingEnvDirsFromUserRc?: number;
1465+
/**
1466+
* Number of conda envs that were not found by us, and the envs belong to env_dirs in the other config rc.
1467+
*/
14341468
missingEnvDirsFromOtherRc?: number;
1469+
/**
1470+
* Number of conda envs that were not found by us, and the envs belong to env_dirs in the sys config rc.
1471+
*/
14351472
missingFromSysRcEnvDirs?: number;
1473+
/**
1474+
* Number of conda envs that were not found by us, and the envs belong to env_dirs in the user config rc.
1475+
*/
14361476
missingFromUserRcEnvDirs?: number;
1477+
/**
1478+
* Number of conda envs that were not found by us, and the envs belong to env_dirs in the other config rc.
1479+
*/
14371480
missingFromOtherRcEnvDirs?: number;
14381481
};
14391482
/**

0 commit comments

Comments
 (0)