add sqm id for windows (#195377)

* add sqm id for windows

* Update src/vs/platform/windows/electron-main/windowsMainService.ts

* Update src/vs/platform/sharedProcess/node/sharedProcess.ts

* react on review comments

* The reg entry is called MachineId not MachineGuid

* fix compile error

* no need for \\ prefix in reg path

* Wait for 1s max (as to not block the startup) to read the SQM value

---------

Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
This commit is contained in:
Isidor Nikolic
2023-10-12 13:47:40 -07:00
committed by GitHub
co-authored by Benjamin Pasero
parent 8de0cf79d2
commit 9d32835bd7
19 changed files with 91 additions and 28 deletions
+3 -2
View File
@@ -57,7 +57,7 @@ import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'
import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService';
import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile';
import { UserDataProfilesReadonlyService } from 'vs/platform/userDataProfile/node/userDataProfile';
import { resolveMachineId } from 'vs/platform/telemetry/node/telemetryUtils';
import { resolveMachineId, resolveSqmId } from 'vs/platform/telemetry/node/telemetryUtils';
import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/node/extensionsProfileScannerService';
import { LogService } from 'vs/platform/log/common/logService';
import { LoggerService } from 'vs/platform/log/node/loggerService';
@@ -184,6 +184,7 @@ class CliMain extends Disposable {
logService.error(error);
}
}
const sqmId = await resolveSqmId(stateService, logService);
// Initialize user data profiles after initializing the state
userDataProfilesService.init();
@@ -219,7 +220,7 @@ class CliMain extends Disposable {
const config: ITelemetryServiceConfig = {
appenders,
sendErrorTelemetry: false,
commonProperties: resolveCommonProperties(release(), hostname(), process.arch, productService.commit, productService.version, machineId, isInternal),
commonProperties: resolveCommonProperties(release(), hostname(), process.arch, productService.commit, productService.version, machineId, sqmId, isInternal),
piiPaths: getPiiPathsFromEnvironment(environmentService)
};
@@ -303,7 +303,7 @@ class SharedProcessMain extends Disposable implements IClientConnectionFilter {
telemetryService = new TelemetryService({
appenders,
commonProperties: resolveCommonProperties(release(), hostname(), process.arch, productService.commit, productService.version, this.configuration.machineId, internalTelemetry),
commonProperties: resolveCommonProperties(release(), hostname(), process.arch, productService.commit, productService.version, this.configuration.machineId, this.configuration.sqmId, internalTelemetry),
sendErrorTelemetry: true,
piiPaths: getPiiPathsFromEnvironment(environmentService),
}, configurationService, productService);