From 7d5ece376cbd083d54ac7fb953a4ed1ec73bd4dc Mon Sep 17 00:00:00 2001 From: kieferrm Date: Sun, 3 Sep 2017 17:48:05 -0700 Subject: [PATCH] classify common properties --- src/vs/code/electron-browser/sharedProcessMain.ts | 1 + src/vs/code/electron-main/app.ts | 1 + src/vs/platform/telemetry/node/commonProperties.ts | 10 ++++++++++ .../telemetry/node/workbenchCommonProperties.ts | 10 ++++++++++ 4 files changed, 22 insertions(+) diff --git a/src/vs/code/electron-browser/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcessMain.ts index ef7a31319cf89..9fe8189cc0733 100644 --- a/src/vs/code/electron-browser/sharedProcessMain.ts +++ b/src/vs/code/electron-browser/sharedProcessMain.ts @@ -108,6 +108,7 @@ function main(server: Server, initData: ISharedProcessInitData): void { const config: ITelemetryServiceConfig = { appender, commonProperties: resolveCommonProperties(product.commit, pkg.version) + // __GDPR__COMMON__ "common.machineId" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } .then(result => Object.defineProperty(result, 'common.machineId', { get: () => storageService.get(machineIdStorageKey), enumerable: true diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 24cc017e1203b..01f248fc96bd6 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -295,6 +295,7 @@ export class CodeApplication { const channel = getDelayedChannel(this.sharedProcessClient.then(c => c.getChannel('telemetryAppender'))); const appender = new TelemetryAppenderClient(channel); const commonProperties = resolveCommonProperties(product.commit, pkg.version) + // __GDPR__COMMON__ "common.machineId" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } .then(result => Object.defineProperty(result, 'common.machineId', { get: () => this.storageService.getItem(machineIdStorageKey), enumerable: true diff --git a/src/vs/platform/telemetry/node/commonProperties.ts b/src/vs/platform/telemetry/node/commonProperties.ts index 5e6611497c30c..213f6f4b35e73 100644 --- a/src/vs/platform/telemetry/node/commonProperties.ts +++ b/src/vs/platform/telemetry/node/commonProperties.ts @@ -14,26 +14,36 @@ export const machineIdIpcChannel = 'vscode:machineId'; export function resolveCommonProperties(commit: string, version: string): TPromise<{ [name: string]: string; }> { const result: { [name: string]: string; } = Object.create(null); + // __GDPR__COMMON__ "sessionID" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } result['sessionID'] = uuid.generateUuid() + Date.now(); + // __GDPR__COMMON__ "commitHash" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } result['commitHash'] = commit; + // __GDPR__COMMON__ "version" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } result['version'] = version; + // __GDPR__COMMON__ "common.osVersion" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } result['common.osVersion'] = os.release(); + // __GDPR__COMMON__ "common.platfrom" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } result['common.platform'] = Platform.Platform[Platform.platform]; + // __GDPR__COMMON__ "common.nodePlatform" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } result['common.nodePlatform'] = process.platform; + // __GDPR__COMMON__ "common.nodeArch" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } result['common.nodeArch'] = process.arch; // dynamic properties which value differs on each call let seq = 0; const startTime = Date.now(); Object.defineProperties(result, { + // __GDPR__COMMON__ "timestamp" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } 'timestamp': { get: () => new Date(), enumerable: true }, + // __GDPR__COMMON__ "common.timesincesessionstart" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } 'common.timesincesessionstart': { get: () => Date.now() - startTime, enumerable: true }, + // __GDPR__COMMON__ "common.sequence" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } 'common.sequence': { get: () => seq++, enumerable: true diff --git a/src/vs/platform/telemetry/node/workbenchCommonProperties.ts b/src/vs/platform/telemetry/node/workbenchCommonProperties.ts index 58443e27c9b43..e183d0ba220a1 100644 --- a/src/vs/platform/telemetry/node/workbenchCommonProperties.ts +++ b/src/vs/platform/telemetry/node/workbenchCommonProperties.ts @@ -16,8 +16,11 @@ const SQM_KEY: string = '\\Software\\Microsoft\\SQMClient'; export function resolveWorkbenchCommonProperties(storageService: IStorageService, commit: string, version: string): TPromise<{ [name: string]: string }> { return resolveCommonProperties(commit, version).then(result => { + // __GDPR__COMMON__ "common.version.shell" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } result['common.version.shell'] = process.versions && (process).versions['electron']; + // __GDPR__COMMON__ "common.version.renderer" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } result['common.version.renderer'] = process.versions && (process).versions['chrome']; + // __GDPR__COMMON__ "common.osVersion" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } result['common.osVersion'] = os.release(); const lastSessionDate = storageService.get('telemetry.lastSessionDate'); @@ -25,16 +28,23 @@ export function resolveWorkbenchCommonProperties(storageService: IStorageService storageService.store('telemetry.firstSessionDate', firstSessionDate); storageService.store('telemetry.lastSessionDate', new Date().toUTCString()); + // __GDPR__COMMON__ "common.firstSessionDate" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } result['common.firstSessionDate'] = firstSessionDate; + // __GDPR__COMMON__ "common.lastSessionDate" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } result['common.lastSessionDate'] = lastSessionDate; + // __GDPR__COMMON__ "common.isNewSession" : { "endPoint": "none", "classification": "SystemMetaData", "purpose": "FeatureInsight" } result['common.isNewSession'] = !lastSessionDate ? '1' : '0'; const promises: TPromise[] = []; + // __GDPR__COMMON__ "common.instanceId" : { "endPoint": "none", "classification": "EndUserPseudonymizedInformation", "purpose": "FeatureInsight" } promises.push(getOrCreateInstanceId(storageService).then(value => result['common.instanceId'] = value)); + // __GDPR__COMMON__ "common.machineId" : { "endPoint": "none", "classification": "EndUserPseudonymizedInformation", "purpose": "FeatureInsight" } promises.push(getOrCreateMachineId(storageService).then(value => result['common.machineId'] = value)); if (process.platform === 'win32') { + // __GDPR__COMMON__ "common.sqm.userid" : { "endPoint": "SqmUserId", "classification": "EndUserPseudonymizedInformation", "purpose": "FeatureInsight" } promises.push(getSqmUserId(storageService).then(value => result['common.sqm.userid'] = value)); + // __GDPR__COMMON__ "common.sqm.machineid" : { "endPoint": "SqmMachineId", "classification": "EndUserPseudonymizedInformation", "purpose": "FeatureInsight" } promises.push(getSqmMachineId(storageService).then(value => result['common.sqm.machineid'] = value)); }