Skip to content

Commit 8cd059e

Browse files
authored
Remove some unused telemetry events from index.ts (#18805)
* remove platform.info * Delete join mailing list events from index.ts * Change python3 property to pythonThree * Delete unused declarations * Remove one more unused declaration
1 parent 253f86a commit 8cd059e

File tree

4 files changed

+5
-68
lines changed

4 files changed

+5
-68
lines changed

src/client/common/platform/platformService.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import { injectable } from 'inversify';
77
import * as os from 'os';
88
import { coerce, SemVer } from 'semver';
9-
import { sendTelemetryEvent } from '../../telemetry';
10-
import { EventName, PlatformErrors } from '../../telemetry/constants';
119
import { getSearchPathEnvVarNames } from '../utils/exec';
1210
import { Architecture, getArchitecture, getOSType, OSType } from '../utils/platform';
1311
import { parseSemVerSafe } from '../utils/version';
@@ -19,14 +17,6 @@ export class PlatformService implements IPlatformService {
1917

2018
public version?: SemVer;
2119

22-
constructor() {
23-
if (this.osType === OSType.Unknown) {
24-
sendTelemetryEvent(EventName.PLATFORM_INFO, undefined, {
25-
failureType: PlatformErrors.FailedToDetermineOS,
26-
});
27-
}
28-
}
29-
3020
public get pathVariableName(): 'Path' | 'PATH' {
3121
return getSearchPathEnvVarNames(this.osType)[0];
3222
}
@@ -48,17 +38,11 @@ export class PlatformService implements IPlatformService {
4838
try {
4939
const ver = coerce(os.release());
5040
if (ver) {
51-
sendTelemetryEvent(EventName.PLATFORM_INFO, undefined, {
52-
osVersion: `${ver.major}.${ver.minor}.${ver.patch}`,
53-
});
5441
this.version = ver;
5542
return this.version;
5643
}
5744
throw new Error('Unable to parse version');
5845
} catch (ex) {
59-
sendTelemetryEvent(EventName.PLATFORM_INFO, undefined, {
60-
failureType: PlatformErrors.FailedToParseVersion,
61-
});
6246
return parseSemVerSafe(os.release());
6347
}
6448
default:

src/client/startupTelemetry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async function getActivationTelemetryProps(serviceContainer: IServiceContainer):
9393
const mainWorkspaceUri = workspaceService.hasWorkspaceFolders
9494
? workspaceService.workspaceFolders![0].uri
9595
: undefined;
96-
const [condaVersion, hasPython3] = await Promise.all([
96+
const [condaVersion, hasPythonThree] = await Promise.all([
9797
condaLocator
9898
.getCondaVersion()
9999
.then((ver) => (ver ? ver.raw : ''))
@@ -125,7 +125,7 @@ async function getActivationTelemetryProps(serviceContainer: IServiceContainer):
125125
pythonVersion,
126126
interpreterType,
127127
workspaceFolderCount,
128-
hasPython3,
128+
hasPythonThree,
129129
usingUserDefinedInterpreter,
130130
usingGlobalInterpreter,
131131
};

src/client/telemetry/constants.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ export enum EventName {
6464
PYTHON_EXPERIMENTS_OPT_IN_OPT_OUT_SETTINGS = 'PYTHON_EXPERIMENTS_OPT_IN_OPT_OUT_SETTINGS',
6565

6666
EXTENSION_SURVEY_PROMPT = 'EXTENSION_SURVEY_PROMPT',
67-
JOIN_MAILING_LIST_PROMPT_DISPLAYED = 'JOIN_MAILING_LIST_PROMPT_DISPLAYED',
68-
JOIN_MAILING_LIST_PROMPT = 'JOIN_MAILING_LIST_PROMPT',
6967

7068
PYTHON_LANGUAGE_SERVER_STARTUP_DURATION = 'PYTHON_LANGUAGE_SERVER_STARTUP_DURATION',
7169
PYTHON_LANGUAGE_SERVER_CURRENT_SELECTION = 'PYTHON_LANGUAGE_SERVER_CURRENT_SELECTION',
@@ -81,7 +79,6 @@ export enum EventName {
8179
ACTIVATE_ENV_TO_GET_ENV_VARS_FAILED = 'ACTIVATE_ENV_TO_GET_ENV_VARS_FAILED',
8280
DIAGNOSTICS_ACTION = 'DIAGNOSTICS.ACTION',
8381
DIAGNOSTICS_MESSAGE = 'DIAGNOSTICS.MESSAGE',
84-
PLATFORM_INFO = 'PLATFORM.INFO',
8582

8683
SELECT_LINTER = 'LINTING.SELECT',
8784
USE_REPORT_ISSUE_COMMAND = 'USE_REPORT_ISSUE_COMMAND',

src/client/telemetry/index.ts

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
TensorBoardSessionStartResult,
2222
TensorBoardEntrypoint,
2323
} from '../tensorBoard/constants';
24-
import { EventName, PlatformErrors } from './constants';
24+
import { EventName } from './constants';
2525
import type { LinterTrigger, TestTool } from './types';
2626

2727
/**
@@ -742,7 +742,7 @@ export interface IEventNamePropertyMapping {
742742
"interpretertype" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "luabud" },
743743
"terminal" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "luabud" },
744744
"workspacefoldercount" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "luabud" },
745-
"haspython3" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "luabud" },
745+
"haspythonthree" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "luabud" },
746746
"startactivatetime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "luabud" },
747747
"totalactivatetime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "luabud" },
748748
"totalnonblockingactivatetime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "luabud" },
@@ -776,7 +776,7 @@ export interface IEventNamePropertyMapping {
776776
/**
777777
* If interpreters found for the main workspace contains a python3 interpreter
778778
*/
779-
hasPython3?: boolean;
779+
hasPythonThree?: boolean;
780780
/**
781781
* If user has defined an interpreter in settings.json
782782
*/
@@ -1029,29 +1029,6 @@ export interface IEventNamePropertyMapping {
10291029
*/
10301030
executableSpecified: boolean;
10311031
};
1032-
/**
1033-
* Telemetry event sent after fetching the OS version
1034-
*/
1035-
/* __GDPR__
1036-
"platform.info" : {
1037-
"failuretype" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "luabud" },
1038-
"osversion" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "luabud" }
1039-
}
1040-
*/
1041-
[EventName.PLATFORM_INFO]: {
1042-
/**
1043-
* If fetching OS version fails, list the failure type
1044-
*
1045-
* @type {PlatformErrors}
1046-
*/
1047-
failureType?: PlatformErrors;
1048-
/**
1049-
* The OS version of the platform
1050-
*
1051-
* @type {string}
1052-
*/
1053-
osVersion?: string;
1054-
};
10551032
/**
10561033
* Telemetry event sent when an environment without contain a python binary is selected.
10571034
*/
@@ -1595,27 +1572,6 @@ export interface IEventNamePropertyMapping {
15951572
*/
15961573
selection: 'Yes' | 'Maybe later' | 'Do not show again' | undefined;
15971574
};
1598-
/**
1599-
* Telemetry sent back when join mailing list prompt is shown.
1600-
*/
1601-
/* __GDPR__
1602-
"join_mailing_list_prompt_displayed" : { }
1603-
*/
1604-
[EventName.JOIN_MAILING_LIST_PROMPT_DISPLAYED]: never | undefined;
1605-
/**
1606-
* Telemetry sent back when user selects an option from join mailing list prompt.
1607-
*/
1608-
/* __GDPR__
1609-
"join_mailing_list_prompt" : {
1610-
"selection" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "luabud" }
1611-
}
1612-
*/
1613-
[EventName.JOIN_MAILING_LIST_PROMPT]: {
1614-
/**
1615-
* Carries the selection of user when they are asked to join the mailing list.
1616-
*/
1617-
selection: 'Yes' | 'No' | undefined;
1618-
};
16191575
/**
16201576
* Telemetry event sent when starting REPL
16211577
*/

0 commit comments

Comments
 (0)