Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete unwanted telemetry events #238130

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ class SharedProcessMain extends Disposable implements IClientConnectionFilter {
instantiationService.invokeFunction(accessor => {
const logService = accessor.get(ILogService);
const telemetryService = accessor.get(ITelemetryService);
const userDataProfilesService = accessor.get(IUserDataProfilesService);

// Log info
logService.trace('sharedProcess configuration', JSON.stringify(this.configuration));
Expand All @@ -173,10 +172,6 @@ class SharedProcessMain extends Disposable implements IClientConnectionFilter {
// Error handler
this.registerErrorHandler(logService);

// Report Profiles Info
this.reportProfilesInfo(telemetryService, userDataProfilesService);
this._register(userDataProfilesService.onDidChangeProfiles(() => this.reportProfilesInfo(telemetryService, userDataProfilesService)));

// Report Client OS/DE Info
this.reportClientOSInfo(telemetryService, logService);
});
Expand Down Expand Up @@ -455,20 +450,6 @@ class SharedProcessMain extends Disposable implements IClientConnectionFilter {
});
}

private reportProfilesInfo(telemetryService: ITelemetryService, userDataProfilesService: IUserDataProfilesService): void {
type ProfilesInfoClassification = {
owner: 'sandy081';
comment: 'Report profiles information';
count: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Number of profiles' };
};
type ProfilesInfoEvent = {
count: number;
};
telemetryService.publicLog2<ProfilesInfoEvent, ProfilesInfoClassification>('profilesInfo', {
count: userDataProfilesService.profiles.length
});
}

private async reportClientOSInfo(telemetryService: ITelemetryService, logService: ILogService): Promise<void> {
if (isLinux) {
const [releaseInfo, displayProtocol] = await Promise.all([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { IUserDataProfilesService } from '../../userDataProfile/common/userDataP
import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js';
import { Mutable, isObject, isString, isUndefined } from '../../../base/common/types.js';
import { getErrorMessage } from '../../../base/common/errors.js';
import { ITelemetryService } from '../../telemetry/common/telemetry.js';

interface IStoredProfileExtension {
identifier: IExtensionIdentifier;
Expand Down Expand Up @@ -110,7 +109,6 @@ export abstract class AbstractExtensionsProfileScannerService extends Disposable
@IFileService private readonly fileService: IFileService,
@IUserDataProfilesService private readonly userDataProfilesService: IUserDataProfilesService,
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
@ITelemetryService private readonly telemetryService: ITelemetryService,
@ILogService private readonly logService: ILogService,
) {
super();
Expand Down Expand Up @@ -244,13 +242,13 @@ export abstract class AbstractExtensionsProfileScannerService extends Disposable
}
if (storedProfileExtensions) {
if (!Array.isArray(storedProfileExtensions)) {
this.reportAndThrowInvalidConentError(file);
this.throwInvalidConentError(file);
}
// TODO @sandy081: Remove this migration after couple of releases
let migrate = false;
for (const e of storedProfileExtensions) {
if (!isStoredProfileExtension(e)) {
this.reportAndThrowInvalidConentError(file);
this.throwInvalidConentError(file);
}
let location: URI;
if (isString(e.relativeLocation) && e.relativeLocation) {
Expand Down Expand Up @@ -302,15 +300,8 @@ export abstract class AbstractExtensionsProfileScannerService extends Disposable
});
}

private reportAndThrowInvalidConentError(file: URI): void {
type ErrorClassification = {
owner: 'sandy081';
comment: 'Information about the error that occurred while scanning';
code: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'error code' };
};
const error = new ExtensionsProfileScanningError(`Invalid extensions content in ${file.toString()}`, ExtensionsProfileScanningErrorCode.ERROR_INVALID_CONTENT);
this.telemetryService.publicLogError2<{ code: string }, ErrorClassification>('extensionsProfileScanningError', { code: error.code });
throw error;
private throwInvalidConentError(file: URI): void {
throw new ExtensionsProfileScanningError(`Invalid extensions content in ${file.toString()}`, ExtensionsProfileScanningErrorCode.ERROR_INVALID_CONTENT);
}

private toRelativePath(extensionLocation: URI): string | undefined {
Expand Down
17 changes: 0 additions & 17 deletions src/vs/platform/files/browser/indexedDBFileSystemProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,6 @@
import { DBClosedError, IndexedDB } from '../../../base/browser/indexedDB.js';
import { BroadcastDataChannel } from '../../../base/browser/broadcast.js';

export type IndexedDBFileSystemProviderErrorDataClassification = {
owner: 'sandy081';
comment: 'Information about errors that occur in the IndexedDB file system provider';
readonly scheme: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'IndexedDB file system provider scheme for which this error occurred' };
readonly operation: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'operation during which this error occurred' };
readonly code: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'error code' };
};

export type IndexedDBFileSystemProviderErrorData = {
readonly scheme: string;
readonly operation: string;
readonly code: string;
};

// Standard FS Errors (expected to be thrown in production when invalid FS operations are requested)
const ERR_FILE_NOT_FOUND = createFileSystemProviderError(localize('fileNotExists', "File does not exist"), FileSystemProviderErrorCode.FileNotFound);
const ERR_FILE_IS_DIR = createFileSystemProviderError(localize('fileIsDirectory', "File is Directory"), FileSystemProviderErrorCode.FileIsADirectory);
Expand Down Expand Up @@ -179,9 +165,6 @@
private readonly _onDidChangeFile = this._register(new Emitter<readonly IFileChange[]>());
readonly onDidChangeFile: Event<readonly IFileChange[]> = this._onDidChangeFile.event;

private readonly _onReportError = this._register(new Emitter<IndexedDBFileSystemProviderErrorData>());
readonly onReportError = this._onReportError.event;

private readonly mtimes = new Map<string, number>();

private cachedFiletree: Promise<IndexedDBFileSystemNode> | undefined;
Expand Down Expand Up @@ -453,7 +436,7 @@
}

private reportError(operation: string, error: Error): void {
this._onReportError.fire({ scheme: this.scheme, operation, code: error instanceof FileSystemProviderError || error instanceof DBClosedError ? error.code : 'unknown' });

Check failure on line 439 in src/vs/platform/files/browser/indexedDBFileSystemProvider.ts

View workflow job for this annotation

GitHub Actions / Monaco Editor checks

Property '_onReportError' does not exist on type 'IndexedDBFileSystemProvider'. Did you mean 'reportError'?
}

}
8 changes: 0 additions & 8 deletions src/vs/platform/userDataSync/common/abstractSynchronizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ import {
} from './userDataSync.js';
import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js';

type IncompatibleSyncSourceClassification = {
owner: 'sandy081';
comment: 'Information about the sync resource that is incompatible';
source: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'settings sync resource. eg., settings, keybindings...' };
};

export function isRemoteUserData(thing: any): thing is IRemoteUserData {
if (thing
&& (thing.ref !== undefined && typeof thing.ref === 'string' && thing.ref !== '')
Expand Down Expand Up @@ -325,8 +319,6 @@ export abstract class AbstractSynchroniser extends Disposable implements IUserDa

private async performSync(remoteUserData: IRemoteUserData, lastSyncUserData: IRemoteUserData | null, strategy: SyncStrategy, userDataSyncConfiguration: IUserDataSyncConfiguration): Promise<SyncStatus> {
if (remoteUserData.syncData && remoteUserData.syncData.version > this.version) {
// current version is not compatible with cloud version
this.telemetryService.publicLog2<{ source: string }, IncompatibleSyncSourceClassification>('sync/incompatible', { source: this.resource });
throw new UserDataSyncError(localize({ key: 'incompatible', comment: ['This is an error while syncing a resource that its local version is not compatible with its remote version.'] }, "Cannot sync {0} as its local version {1} is not compatible with its remote version {2}", this.resource, this.version, remoteUserData.syncData.version), UserDataSyncErrorCode.IncompatibleLocalContent, this.resource);
}

Expand Down
22 changes: 0 additions & 22 deletions src/vs/platform/userDataSync/common/userDataAutoSyncService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@ import { IUserDataSyncTask, IUserDataAutoSyncService, IUserDataManifest, IUserDa
import { IUserDataSyncAccountService } from './userDataSyncAccount.js';
import { IUserDataSyncMachinesService } from './userDataSyncMachines.js';

type AutoSyncClassification = {
owner: 'sandy081';
comment: 'Information about the sources triggering auto sync';
sources: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Source that triggered auto sync' };
providerId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Auth provider id used for sync' };
};

type AutoSyncErrorClassification = {
owner: 'sandy081';
comment: 'Information about the error that causes auto sync to fail';
code: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'error code' };
service: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Settings sync service for which this error has occurred' };
};

const disableMachineEventuallyKey = 'sync.disableMachineEventually';
const sessionIdKey = 'sync.sessionId';
const storeUrlKey = 'sync.storeUrl';
Expand Down Expand Up @@ -199,7 +185,6 @@ export class UserDataAutoSyncService extends Disposable implements IUserDataAuto

// Reset
if (everywhere) {
this.telemetryService.publicLog2<{}, { owner: 'sandy081'; comment: 'Reporting when settings sync is turned off in all devices' }>('sync/turnOffEveryWhere');
await this.userDataSyncService.reset();
} else {
await this.userDataSyncService.resetLocal();
Expand Down Expand Up @@ -235,11 +220,6 @@ export class UserDataAutoSyncService extends Disposable implements IUserDataAuto
// Error while syncing
const userDataSyncError = UserDataSyncError.toUserDataSyncError(error);

// Log to telemetry
if (userDataSyncError instanceof UserDataAutoSyncError) {
this.telemetryService.publicLog2<{ code: string; service: string }, AutoSyncErrorClassification>(`autosync/error`, { code: userDataSyncError.code, service: this.userDataSyncStoreManagementService.userDataSyncStore!.url.toString() });
}

// Session got expired
if (userDataSyncError.code === UserDataSyncErrorCode.SessionExpired) {
await this.turnOff(false, true /* force soft turnoff on error */);
Expand Down Expand Up @@ -361,8 +341,6 @@ export class UserDataAutoSyncService extends Disposable implements IUserDataAuto
this.sources.push(...sources);
return this.syncTriggerDelayer.trigger(async () => {
this.logService.trace('activity sources', ...this.sources);
const providerId = this.userDataSyncAccountService.account?.authenticationProviderId || '';
this.telemetryService.publicLog2<{ sources: string[]; providerId: string }, AutoSyncClassification>('sync/triggered', { sources: this.sources, providerId });
this.sources = [];
if (this.autoSync.value) {
await this.autoSync.value.sync('Activity', disableCache);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@ import { Disposable } from '../../../base/common/lifecycle.js';
import { isWeb } from '../../../base/common/platform.js';
import { IEnvironmentService } from '../../environment/common/environment.js';
import { IApplicationStorageValueChangeEvent, IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js';
import { ITelemetryService } from '../../telemetry/common/telemetry.js';
import { ALL_SYNC_RESOURCES, getEnablementKey, IUserDataSyncEnablementService, IUserDataSyncStoreManagementService, SyncResource } from './userDataSync.js';

type SyncEnablementClassification = {
owner: 'sandy081';
comment: 'Reporting when Settings Sync is turned on or off';
enabled?: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Flag indicating if settings sync is enabled or not' };
};

const enablementKey = 'sync.enable';

export class UserDataSyncEnablementService extends Disposable implements IUserDataSyncEnablementService {
Expand All @@ -31,7 +24,6 @@ export class UserDataSyncEnablementService extends Disposable implements IUserDa

constructor(
@IStorageService private readonly storageService: IStorageService,
@ITelemetryService private readonly telemetryService: ITelemetryService,
@IEnvironmentService protected readonly environmentService: IEnvironmentService,
@IUserDataSyncStoreManagementService private readonly userDataSyncStoreManagementService: IUserDataSyncStoreManagementService,
) {
Expand All @@ -57,7 +49,6 @@ export class UserDataSyncEnablementService extends Disposable implements IUserDa
if (enabled && !this.canToggleEnablement()) {
return;
}
this.telemetryService.publicLog2<{ enabled: boolean }, SyncEnablementClassification>(enablementKey, { enabled });
this.storageService.store(enablementKey, enabled, StorageScope.APPLICATION, StorageTarget.MACHINE);
}

Expand Down
10 changes: 1 addition & 9 deletions src/vs/workbench/browser/web.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { isWorkspaceToOpen, isFolderToOpen } from '../../platform/window/common/
import { getSingleFolderWorkspaceIdentifier, getWorkspaceIdentifier } from '../services/workspaces/browser/workspaces.js';
import { InMemoryFileSystemProvider } from '../../platform/files/common/inMemoryFilesystemProvider.js';
import { ICommandService } from '../../platform/commands/common/commands.js';
import { IndexedDBFileSystemProviderErrorDataClassification, IndexedDBFileSystemProvider, IndexedDBFileSystemProviderErrorData } from '../../platform/files/browser/indexedDBFileSystemProvider.js';
import { IndexedDBFileSystemProvider } from '../../platform/files/browser/indexedDBFileSystemProvider.js';
import { BrowserRequestService } from '../services/request/browser/requestService.js';
import { IRequestService } from '../../platform/request/common/request.js';
import { IUserDataInitializationService, IUserDataInitializer, UserDataInitializationService } from '../services/userData/browser/userDataInit.js';
Expand All @@ -64,7 +64,6 @@ import { IOpenerService } from '../../platform/opener/common/opener.js';
import { mixin, safeStringify } from '../../base/common/objects.js';
import { IndexedDB } from '../../base/browser/indexedDB.js';
import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js';
import { ITelemetryService } from '../../platform/telemetry/common/telemetry.js';
import { IProgressService } from '../../platform/progress/common/progress.js';
import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js';
import { dirname, joinPath } from '../../base/common/resources.js';
Expand Down Expand Up @@ -137,13 +136,6 @@ export class BrowserMain extends Disposable {
// Logging
services.logService.trace('workbench#open with configuration', safeStringify(this.configuration));

instantiationService.invokeFunction(accessor => {
const telemetryService = accessor.get(ITelemetryService);
for (const indexedDbFileSystemProvider of this.indexedDBFileSystemProviders) {
this._register(indexedDbFileSystemProvider.onReportError(e => telemetryService.publicLog2<IndexedDBFileSystemProviderErrorData, IndexedDBFileSystemProviderErrorDataClassification>('indexedDBFileSystemProviderError', e)));
}
});

// Return API Facade
return instantiationService.invokeFunction(accessor => {
const commandService = accessor.get(ICommandService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ import { IRemoteExtensionsScannerService } from '../../../../platform/remote/com
import { IUserDataInitializationService } from '../../../services/userData/browser/userDataInit.js';
import { isString } from '../../../../base/common/types.js';

type IgnoreRecommendationClassification = {
owner: 'sandy081';
comment: 'Report when a recommendation is ignored';
recommendationReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Reason why extension is recommended' };
extensionId: { classification: 'PublicNonPersonalData'; purpose: 'FeatureInsight'; comment: 'Id of the extension recommendation that is being ignored' };
};

export class ExtensionRecommendationsService extends Disposable implements IExtensionRecommendationsService {

declare readonly _serviceBrand: undefined;
Expand Down Expand Up @@ -115,14 +108,6 @@ export class ExtensionRecommendationsService extends Disposable implements IExte
]);

this._register(Event.any(this.workspaceRecommendations.onDidChangeRecommendations, this.configBasedRecommendations.onDidChangeRecommendations, this.extensionRecommendationsManagementService.onDidChangeIgnoredRecommendations)(() => this._onDidChangeRecommendations.fire()));
this._register(this.extensionRecommendationsManagementService.onDidChangeGlobalIgnoredRecommendation(({ extensionId, isRecommended }) => {
if (!isRecommended) {
const reason = this.getAllRecommendationsWithReason()[extensionId];
if (reason && reason.reasonId) {
this.telemetryService.publicLog2<{ extensionId: string; recommendationReason: ExtensionRecommendationReason }, IgnoreRecommendationClassification>('extensionsRecommendations:ignoreRecommendation', { extensionId, recommendationReason: reason.reasonId });
}
}
}));

this.promptWorkspaceRecommendations();
}
Expand Down
11 changes: 0 additions & 11 deletions src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { onUnexpectedError } from '../../../../base/common/errors.js';
import { renderIcon } from '../../../../base/browser/ui/iconLabel/iconLabels.js';
import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';
import { KeyCode } from '../../../../base/common/keyCodes.js';
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
import { defaultCountBadgeStyles } from '../../../../platform/theme/browser/defaultStyles.js';
import { getDefaultHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegateFactory.js';
import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.js';
Expand Down Expand Up @@ -247,7 +246,6 @@ export class SponsorWidget extends ExtensionWidget {
private container: HTMLElement,
@IHoverService private readonly hoverService: IHoverService,
@IOpenerService private readonly openerService: IOpenerService,
@ITelemetryService private readonly telemetryService: ITelemetryService,
) {
super();
this.render();
Expand All @@ -267,15 +265,6 @@ export class SponsorWidget extends ExtensionWidget {
const label = $('span', undefined, localize('sponsor', "Sponsor"));
append(sponsor, sponsorIconElement, label);
this.disposables.add(onClick(sponsor, () => {
type SponsorExtensionClassification = {
owner: 'sandy081';
comment: 'Reporting when sponosor extension action is executed';
'extensionId': { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Id of the extension to be sponsored' };
};
type SponsorExtensionEvent = {
'extensionId': string;
};
this.telemetryService.publicLog2<SponsorExtensionEvent, SponsorExtensionClassification>('extensionsAction.sponsorExtension', { extensionId: this.extension!.identifier.id });
this.openerService.open(this.extension!.publisherSponsorLink!);
}));
}
Expand Down
Loading
Loading