Switch to 1DS endpoint (#20769)

* Update to 1DS client

* remove product config

* Update ai keys

* use our own event prefix

* re-enable telemetry

* Update distro and remove default enableTelemetry

* distro

* Remove asimovKey references

* add comment

* distro

* distro

* distro

* add files that break precommit hook

* cleanup/fixes

* distro

* distro + event prefix update

* distro

* more
This commit is contained in:
Charles Gagnon
2022-11-03 08:45:06 -07:00
committed by GitHub
parent ca78491238
commit fb05c4304e
54 changed files with 795 additions and 462 deletions

View File

@@ -63,8 +63,7 @@ import { ICustomEndpointTelemetryService, ITelemetryService } from 'vs/platform/
import { TelemetryAppenderChannel } from 'vs/platform/telemetry/common/telemetryIpc';
import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender';
import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
import { supportsTelemetry, ITelemetryAppender, NullAppender, NullTelemetryService, getPiiPathsFromEnvironment } from 'vs/platform/telemetry/common/telemetryUtils';
import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender';
import { supportsTelemetry, ITelemetryAppender, NullAppender, NullTelemetryService, isInternalTelemetry, getPiiPathsFromEnvironment } from 'vs/platform/telemetry/common/telemetryUtils';
import { CustomEndpointTelemetryService } from 'vs/platform/telemetry/node/customEndpointTelemetryService';
import { LocalReconnectConstants, TerminalIpcChannels, TerminalSettingId } from 'vs/platform/terminal/common/terminal';
import { ILocalPtyService } from 'vs/platform/terminal/electron-sandbox/terminal';
@@ -91,6 +90,7 @@ import { ipcSharedProcessTunnelChannelName, ISharedProcessTunnelService } from '
import { SharedProcessTunnelService } from 'vs/platform/tunnel/node/sharedProcessTunnelService';
import { ipcSharedProcessWorkerChannelName, ISharedProcessWorkerConfiguration, ISharedProcessWorkerService } from 'vs/platform/sharedProcess/common/sharedProcessWorkerService';
import { SharedProcessWorkerService } from 'vs/platform/sharedProcess/electron-browser/sharedProcessWorkerService';
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService';
import { isLinux } from 'vs/base/common/platform';
@@ -263,16 +263,15 @@ class SharedProcessMain extends Disposable {
// Telemetry
let telemetryService: ITelemetryService;
const appenders: ITelemetryAppender[] = [];
const internalTelemetry = isInternalTelemetry(productService, configurationService);
if (supportsTelemetry(productService, environmentService)) {
const logAppender = new TelemetryLogAppender(loggerService, environmentService);
appenders.push(logAppender);
const { installSourcePath } = environmentService;
// Application Insights
if (productService.aiConfig && productService.aiConfig.asimovKey) {
const appInsightsAppender = new AppInsightsAppender('adsworkbench', null, productService.aiConfig.asimovKey); // {{SQL CARBON EDIT}} Use our own event prefix
this._register(toDisposable(() => appInsightsAppender.flush())); // Ensure the AI appender is disposed so that it flushes remaining data
appenders.push(appInsightsAppender);
if (productService.aiConfig?.ariaKey) {
const collectorAppender = new OneDataSystemAppender(internalTelemetry, 'adsworkbench', null, productService.aiConfig.ariaKey); // {{SQL CARBON EDIT}} Use our own event prefix
this._register(toDisposable(() => collectorAppender.flush())); // Ensure the 1DS appender is disposed so that it flushes remaining data
appenders.push(collectorAppender);
}
telemetryService = new TelemetryService({

View File

@@ -46,8 +46,8 @@ import { RequestService } from 'vs/platform/request/node/requestService';
import { resolveCommonProperties } from 'vs/platform/telemetry/common/commonProperties';
import { ITelemetryService, machineIdKey } from 'vs/platform/telemetry/common/telemetry';
import { ITelemetryServiceConfig, TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
import { supportsTelemetry, NullTelemetryService, getPiiPathsFromEnvironment } from 'vs/platform/telemetry/common/telemetryUtils';
import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender';
import { supportsTelemetry, NullTelemetryService, isInternalTelemetry, getPiiPathsFromEnvironment } from 'vs/platform/telemetry/common/telemetryUtils';
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
import { buildTelemetryMessage } from 'vs/platform/telemetry/node/telemetry';
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService';
@@ -96,7 +96,7 @@ class CliMain extends Disposable {
});
}
private async initServices(): Promise<[IInstantiationService, AppInsightsAppender[]]> {
private async initServices(): Promise<[IInstantiationService, OneDataSystemAppender[]]> {
const services = new ServiceCollection();
// Product
@@ -154,10 +154,11 @@ class CliMain extends Disposable {
services.set(ILocalizationsService, new SyncDescriptor(LocalizationsService));
// Telemetry
const appenders: AppInsightsAppender[] = [];
const appenders: OneDataSystemAppender[] = [];
const isInternal = isInternalTelemetry(productService, configurationService);
if (supportsTelemetry(productService, environmentService)) {
if (productService.aiConfig && productService.aiConfig.asimovKey) {
appenders.push(new AppInsightsAppender('adsworkbench', null, productService.aiConfig.asimovKey)); // {{SQL CARBON EDIT}} Use our own event prefix
if (productService.aiConfig && productService.aiConfig.ariaKey) {
appenders.push(new OneDataSystemAppender(isInternal, 'adsworkbench', null, productService.aiConfig.ariaKey)); // {{SQL CARBON EDIT}} Use our own event prefix
}
const { installSourcePath } = environmentService;