Skip to content

Commit e12f9df

Browse files
committed
add common.remoteAuthority
1 parent 53d33ca commit e12f9df

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

src/vs/platform/telemetry/node/workbenchCommonProperties.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const currentSessionDateStorageKey = 'telemetry.currentSessionDate';
1111
export const firstSessionDateStorageKey = 'telemetry.firstSessionDate';
1212
export const lastSessionDateStorageKey = 'telemetry.lastSessionDate';
1313

14-
export async function resolveWorkbenchCommonProperties(storageService: IStorageService, commit: string | undefined, version: string | undefined, machineId: string, installSourcePath: string): Promise<{ [name: string]: string | undefined }> {
14+
export async function resolveWorkbenchCommonProperties(storageService: IStorageService, commit: string | undefined, version: string | undefined, machineId: string, installSourcePath: string, remoteAuthority?: string, product?: string): Promise<{ [name: string]: string | undefined }> {
1515
const result = await resolveCommonProperties(commit, version, machineId, installSourcePath);
1616
const instanceId = storageService.get(instanceStorageKey, StorageScope.GLOBAL)!;
1717
const firstSessionDate = storageService.get(firstSessionDateStorageKey, StorageScope.GLOBAL)!;
@@ -29,6 +29,23 @@ export async function resolveWorkbenchCommonProperties(storageService: IStorageS
2929
result['common.isNewSession'] = !lastSessionDate ? '1' : '0';
3030
// __GDPR__COMMON__ "common.instanceId" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
3131
result['common.instanceId'] = instanceId;
32+
// __GDPR__COMMON__ "common.remoteAuthority" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
33+
result['common.remoteAuthority'] = cleanRemoteAuthority(remoteAuthority);
3234

3335
return result;
3436
}
37+
38+
function cleanRemoteAuthority(remoteAuthority?: string): string {
39+
if (!remoteAuthority) {
40+
return 'none';
41+
}
42+
43+
// Whitelisted remote authorities
44+
['ssh-remote', 'dev-container', 'wsl'].forEach((res: string): string | void => {
45+
if (remoteAuthority!.indexOf(res) === 0) {
46+
return res;
47+
}
48+
});
49+
50+
return 'other';
51+
}

src/vs/workbench/services/telemetry/electron-browser/telemetryService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class TelemetryService extends Disposable implements ITelemetryService {
3737
const channel = sharedProcessService.getChannel('telemetryAppender');
3838
const config: ITelemetryServiceConfig = {
3939
appender: combinedAppender(new TelemetryAppenderClient(channel), new LogAppender(logService)),
40-
commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, environmentService.configuration.machineId, environmentService.installSourcePath),
40+
commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, environmentService.configuration.machineId, environmentService.installSourcePath, environmentService.configuration.remoteAuthority),
4141
piiPaths: [environmentService.appRoot, environmentService.extensionsPath]
4242
};
4343

0 commit comments

Comments
 (0)