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

Get telemetry data only when it is enabled #160079

Merged
merged 1 commit into from Sep 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/vs/platform/externalServices/common/marketplace.ts
Expand Up @@ -20,16 +20,18 @@ export async function resolveMarketplaceHeaders(version: string,
fileService: IFileService,
storageService: IStorageService | undefined,
telemetryService: ITelemetryService): Promise<IHeaders> {

const headers: IHeaders = {
'X-Market-Client-Id': `VSCode ${version}`,
'User-Agent': `VSCode ${version} (${productService.nameShort})`
};
const uuid = await getServiceMachineId(environmentService, fileService, storageService);
const { sessionId } = await telemetryService.getTelemetryInfo();

if (supportsTelemetry(productService, environmentService) && getTelemetryLevel(configurationService) === TelemetryLevel.USAGE) {
const uuid = await getServiceMachineId(environmentService, fileService, storageService);
const { sessionId } = await telemetryService.getTelemetryInfo();
headers['X-Market-User-Id'] = uuid;
headers['VSCode-SessionId'] = sessionId;
}

return headers;
}