@@ -11,7 +11,7 @@ export const currentSessionDateStorageKey = 'telemetry.currentSessionDate';
1111export const firstSessionDateStorageKey = 'telemetry.firstSessionDate' ;
1212export 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+ }
0 commit comments